mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #3267 from MetaMask/i3266-IgnoreZeroGasLimit
Default validated block gas limit to 8MM when none identified
This commit is contained in:
commit
b046378e33
@ -56,7 +56,7 @@ class NonceTracker {
|
|||||||
const blockTracker = this._getBlockTracker()
|
const blockTracker = this._getBlockTracker()
|
||||||
const currentBlock = blockTracker.getCurrentBlock()
|
const currentBlock = blockTracker.getCurrentBlock()
|
||||||
if (currentBlock) return currentBlock
|
if (currentBlock) return currentBlock
|
||||||
return await Promise((reject, resolve) => {
|
return await new Promise((reject, resolve) => {
|
||||||
blockTracker.once('latest', resolve)
|
blockTracker.once('latest', resolve)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,8 @@ PendingTx.prototype.render = function () {
|
|||||||
// Gas
|
// Gas
|
||||||
const gas = txParams.gas
|
const gas = txParams.gas
|
||||||
const gasBn = hexToBn(gas)
|
const gasBn = hexToBn(gas)
|
||||||
const gasLimit = new BN(parseInt(blockGasLimit))
|
// default to 8MM gas limit
|
||||||
|
const gasLimit = new BN(parseInt(blockGasLimit) || '8000000')
|
||||||
const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20)
|
const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20)
|
||||||
const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20)
|
const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20)
|
||||||
const safeGasLimit = safeGasLimitBN.toString(10)
|
const safeGasLimit = safeGasLimitBN.toString(10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user