aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsuan Lee <hsuan@cobinhood.com>2018-11-16 18:20:35 +0800
committerHsuan Lee <hsuan@cobinhood.com>2018-12-10 18:52:34 +0800
commitb32a1c7dafeffb8240071e4e66e6209d631a8a36 (patch)
treedfc40caa03068d71d105913cac8f6fc1cc86aea5
parent5823f6fca838a3ce5fac6ccee87bc99461a720bc (diff)
downloaddexon-wallet-b32a1c7dafeffb8240071e4e66e6209d631a8a36.tar.gz
dexon-wallet-b32a1c7dafeffb8240071e4e66e6209d631a8a36.tar.zst
dexon-wallet-b32a1c7dafeffb8240071e4e66e6209d631a8a36.zip
Refine next nonce determination
-rw-r--r--app/scripts/controllers/transactions/nonce-tracker.js6
1 files 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