mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
nonce-tracker - simplify getHighestNonce
This commit is contained in:
parent
b191649ef5
commit
e43da3e4aa
@ -139,11 +139,9 @@ class NonceTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getHighestNonce (txList) {
|
_getHighestNonce (txList) {
|
||||||
const nonces = txList.map((txMeta) => txMeta.txParams.nonce)
|
const nonces = txList.map((txMeta) => parseInt(txMeta.txParams.nonce, 16))
|
||||||
const nonceHex = nonces.reduce((highestNonce, nonce) => {
|
const highestNonce = Math.max.apply(null, nonces)
|
||||||
return parseInt(nonce, 16) > parseInt(highestNonce, 16) ? nonce : highestNonce
|
return highestNonce
|
||||||
}, '0x0')
|
|
||||||
return parseInt(nonceHex, 16)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is a hotfix for the fact that the blockTracker will
|
// this is a hotfix for the fact that the blockTracker will
|
||||||
|
Loading…
Reference in New Issue
Block a user