|
|
@ -115,13 +115,21 @@ class NonceTracker { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_getHighestNonce (txList) { |
|
|
|
_getHighestNonce (txList) { |
|
|
|
const nonces = txList.map((txMeta) => parseInt(txMeta.txParams.nonce, 16)) |
|
|
|
const nonces = txList.map((txMeta) => { |
|
|
|
|
|
|
|
const nonce = txMeta.txParams.nonce |
|
|
|
|
|
|
|
assert(typeof nonce, 'string', 'nonces should be hex strings') |
|
|
|
|
|
|
|
return parseInt(nonce, 16) |
|
|
|
|
|
|
|
}) |
|
|
|
const highestNonce = Math.max.apply(null, nonces) |
|
|
|
const highestNonce = Math.max.apply(null, nonces) |
|
|
|
return highestNonce |
|
|
|
return highestNonce |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_getHighestContinuousFrom (txList, startPoint) { |
|
|
|
_getHighestContinuousFrom (txList, startPoint) { |
|
|
|
const nonces = txList.map((txMeta) => parseInt(txMeta.txParams.nonce, 16)) |
|
|
|
const nonces = txList.map((txMeta) => { |
|
|
|
|
|
|
|
const nonce = txMeta.txParams.nonce |
|
|
|
|
|
|
|
assert(typeof nonce, 'string', 'nonces should be hex strings') |
|
|
|
|
|
|
|
return parseInt(nonce, 16) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let highest = startPoint |
|
|
|
let highest = startPoint |
|
|
|
while (nonces.includes(highest)) { |
|
|
|
while (nonces.includes(highest)) { |
|
|
|