diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2018-11-12 15:03:12 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2018-12-10 18:49:11 +0800 |
commit | 4339b40131007598add2961cd9eccec315efd674 (patch) | |
tree | 222cff0ba2a8ba74a147533f14595f98f2811629 | |
parent | 9e3ce3b47367805c080cb167cf6cb9008bc79e47 (diff) | |
download | dexon-wallet-4339b40131007598add2961cd9eccec315efd674.tar.gz dexon-wallet-4339b40131007598add2961cd9eccec315efd674.tar.zst dexon-wallet-4339b40131007598add2961cd9eccec315efd674.zip |
Make noncetracker more resistent to reset
-rw-r--r-- | app/scripts/controllers/transactions/nonce-tracker.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/scripts/controllers/transactions/nonce-tracker.js b/app/scripts/controllers/transactions/nonce-tracker.js index 42103636..feef35df 100644 --- a/app/scripts/controllers/transactions/nonce-tracker.js +++ b/app/scripts/controllers/transactions/nonce-tracker.js @@ -108,7 +108,7 @@ class NonceTracker { // and pending count are from the same block const blockNumber = await this.blockTracker.getLatestBlock() const baseCountBN = await this.ethQuery.getTransactionCount(address, blockNumber) - const baseCount = baseCountBN.toNumber() + const baseCount = baseCountBN && baseCountBN.toNumber() || 0 assert(Number.isInteger(baseCount), `nonce-tracker - baseCount is not an integer - got: (${typeof baseCount}) "${baseCount}"`) const nonceDetails = { blockNumber, baseCount } return { name: 'network', nonce: baseCount, details: nonceDetails } |