|
|
|
@ -115,13 +115,21 @@ class NonceTracker { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_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) |
|
|
|
|
return highestNonce |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_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 |
|
|
|
|
while (nonces.includes(highest)) { |
|
|
|
|