1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

nonce-tracker - getHighestNonce doesnt need uniqued input

This commit is contained in:
kumavis 2017-08-22 13:58:26 -07:00
parent 98bc9b6656
commit b191649ef5

View File

@ -94,9 +94,9 @@ class NonceTracker {
}
async _getlocalNextNonce (address) {
const confirmedTransactions = this._reduceTxListToUniqueNonces(this.getConfirmedTransactions(address))
const pendingTransactions = this._reduceTxListToUniqueNonces(this.getPendingTransactions(address))
const transactions = this._reduceTxListToUniqueNonces(confirmedTransactions.concat(pendingTransactions))
const confirmedTransactions = this.getConfirmedTransactions(address)
const pendingTransactions = this.getPendingTransactions(address)
const transactions = confirmedTransactions.concat(pendingTransactions)
const highestNonce = this._getHighestNonce(transactions)
let localNonce = highestNonce
// throw out localNonce if not a number
@ -115,7 +115,7 @@ class NonceTracker {
}
_getLocalPendingNonce (address) {
const pendingTransactions = this._reduceTxListToUniqueNonces(this.getPendingTransactions(address))
const pendingTransactions = this.getPendingTransactions(address)
const localNonce = this._getHighestNonce(pendingTransactions)
return localNonce
}