diff --git a/CHANGELOG.md b/CHANGELOG.md index 23695ee8cc8..d1b68af24dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -479,3 +479,7 @@ Released with 1.0.0-beta.37 code base. ## [Unreleased] ## [1.6.2] + +### Changed + +- Correct `web3.rst` example in documentation (#4511) \ No newline at end of file diff --git a/docs/web3.rst b/docs/web3.rst index 5ae5666957f..668ae8e0b92 100644 --- a/docs/web3.rst +++ b/docs/web3.rst @@ -64,7 +64,7 @@ The Web3 class is an umbrella package to house all Ethereum related modules. var Web3 = require('web3'); - // "Web3.providers.givenProvider" will be set if in an Ethereum supported browser. + // "Web3.givenProvider" will be set if in an Ethereum supported browser. var web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546'); > web3.eth diff --git a/packages/web3-core-method/src/index.js b/packages/web3-core-method/src/index.js index 7a504591767..afffc8560a1 100644 --- a/packages/web3-core-method/src/index.js +++ b/packages/web3-core-method/src/index.js @@ -205,6 +205,7 @@ Method.prototype._confirmTransaction = function (defer, result, payload) { timeoutCount = 0, confirmationCount = 0, intervalId = null, + blockHeaderTimeoutId = null, lastBlock = null, receiptJSON = '', gasProvided = ((!!payload.params[0] && typeof payload.params[0] === 'object') && payload.params[0].gas) ? payload.params[0].gas : null, @@ -273,6 +274,7 @@ Method.prototype._confirmTransaction = function (defer, result, payload) { sub = { unsubscribe: function () { clearInterval(intervalId); + clearTimeout(blockHeaderTimeoutId); } }; } @@ -572,7 +574,7 @@ Method.prototype._confirmTransaction = function (defer, result, payload) { }); // Fallback to polling if tx receipt didn't arrived in "blockHeaderTimeout" [10 seconds] - setTimeout(() => { + blockHeaderTimeoutId = setTimeout(() => { if(!blockHeaderArrived) { startInterval(); }