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) {
|
||||
const nonces = txList.map((txMeta) => txMeta.txParams.nonce)
|
||||
const nonceHex = nonces.reduce((highestNonce, nonce) => {
|
||||
return parseInt(nonce, 16) > parseInt(highestNonce, 16) ? nonce : highestNonce
|
||||
}, '0x0')
|
||||
return parseInt(nonceHex, 16)
|
||||
const nonces = txList.map((txMeta) => parseInt(txMeta.txParams.nonce, 16))
|
||||
const highestNonce = Math.max.apply(null, nonces)
|
||||
return highestNonce
|
||||
}
|
||||
|
||||
// this is a hotfix for the fact that the blockTracker will
|
||||
|
Loading…
Reference in New Issue
Block a user