aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsuan Lee <hsuan@cobinhood.com>2018-11-12 15:03:12 +0800
committerHsuan Lee <hsuan@cobinhood.com>2018-12-10 18:49:11 +0800
commit4339b40131007598add2961cd9eccec315efd674 (patch)
tree222cff0ba2a8ba74a147533f14595f98f2811629
parent9e3ce3b47367805c080cb167cf6cb9008bc79e47 (diff)
downloaddexon-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.js2
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 }
i2008-01-122-5/+4 * - Fix depends after pear-log updatemiwi2007-06-111-1/+2 * - Update to 1.8.5miwi2007-04-272-5/+5 * - Update to 1.0.3miwi2006-11-132-4/+4 * Reset maintainership of ports assigned to antonio@php.net after numerouslinimon2006-09-231-1/+1 * - Update to 1.0.1pav2006-01-122-6/+8 * Remove pear ports obsolated by devel/pear and switchale2005-12-101-1/+1