aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-11-18 06:05:12 +0800
committerDan Finlay <dan@danfinlay.com>2016-11-18 06:05:12 +0800
commit8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed (patch)
tree975275cc991cdc4f2a0b8decd2db4f429e2f9096 /app/scripts/lib/idStore.js
parentb0ccde66f62ae69c5818ddd43e22fb517f8f13e2 (diff)
downloadtangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.tar
tangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.tar.gz
tangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.tar.bz2
tangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.tar.lz
tangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.tar.xz
tangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.tar.zst
tangerine-wallet-browser-8eb91e89bf62fd835d5e59bd01ac54e0df7c22ed.zip
Increment tx ids to avoid collisions
Fixes #791 It was possible for two requests to have the same ID, causing a crash and loss of StreamProvider connection. This new id generation strategy creates a random ID, and increments it for each request. In case the id generator is included from two different processes, I'm initializing the counter at a random number, and rolling it over a large number when it gets too big.
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 65b8c7029..ccd5efe69 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -7,7 +7,7 @@ const EthQuery = require('eth-query')
const KeyStore = require('eth-lightwallet').keystore
const clone = require('clone')
const extend = require('xtend')
-const createId = require('web3-provider-engine/util/random-id')
+const createId = require('./random-id')
const ethBinToOps = require('eth-bin-to-ops')
const autoFaucet = require('./auto-faucet')
const messageManager = require('./message-manager')