From b32a1c7dafeffb8240071e4e66e6209d631a8a36 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Fri, 16 Nov 2018 18:20:35 +0800 Subject: Refine next nonce determination --- app/scripts/controllers/transactions/nonce-tracker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/transactions/nonce-tracker.js b/app/scripts/controllers/transactions/nonce-tracker.js index feef35df..e671c0cf 100644 --- a/app/scripts/controllers/transactions/nonce-tracker.js +++ b/app/scripts/controllers/transactions/nonce-tracker.js @@ -54,9 +54,9 @@ class NonceTracker { // evaluate multiple nextNonce strategies const nonceDetails = {} const networkNonceResult = await this._getNetworkNextNonce(address) - const highestLocallyConfirmed = this._getHighestLocallyConfirmed(address) const nextNetworkNonce = networkNonceResult.nonce - const highestSuggested = Math.max(nextNetworkNonce, highestLocallyConfirmed) + const highestLocallyConfirmed = nextNetworkNonce + const highestSuggested = nextNetworkNonce const pendingTxs = this.getPendingTransactions(address) const localNonceResult = this._getHighestContinuousFrom(pendingTxs, highestSuggested) || 0 @@ -69,7 +69,7 @@ class NonceTracker { nonceDetails.local = localNonceResult nonceDetails.network = networkNonceResult - const nextNonce = Math.max(networkNonceResult.nonce, localNonceResult.nonce) + const nextNonce = networkNonceResult.nonce assert(Number.isInteger(nextNonce), `nonce-tracker - nextNonce is not an integer - got: (${typeof nextNonce}) "${nextNonce}"`) // return nonce and release cb -- cgit