diff options
author | Dan Finlay <somniac@me.com> | 2016-04-28 09:46:12 +0800 |
---|---|---|
committer | Dan Finlay <somniac@me.com> | 2016-04-28 09:46:12 +0800 |
commit | 9b524b4f28bebbdf8351763b61e897f33021e25b (patch) | |
tree | d5b0f23ec9803f6956f42f9bbfbbd993608e1285 /app/scripts/lib | |
parent | c66ac13cc93948945912690dffc4940f33fa1dfa (diff) | |
parent | bd660d9aeb5638372605377fb92ce1362c3d8230 (diff) | |
download | tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.gz tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.zst tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.zip |
Merge pull request #152 from MetaMask/FilterTransactionList
Filter transaction list for current network
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/idStore.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 92d0f9668..e9aaed82e 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -16,11 +16,11 @@ module.exports = IdentityStore inherits(IdentityStore, EventEmitter) -function IdentityStore(ethStore) { +function IdentityStore(opts = {}) { EventEmitter.call(this) // we just use the ethStore to auto-add accounts - this._ethStore = ethStore + this._ethStore = opts.ethStore // lightwallet key store this._keyStore = null // lightwallet wrapper @@ -110,6 +110,16 @@ IdentityStore.prototype.setSelectedAddress = function(address){ this._didUpdate() } +IdentityStore.prototype.getNetwork = function(tries) { + if (tries === 0) return + this.web3.version.getNetwork((err, network) => { + if (err) { + return this.getNetwork(tries - 1, cb) + } + this._currentState.network = network + }) +} + IdentityStore.prototype.setLocked = function(cb){ delete this._keyStore delete this._idmgmt @@ -137,6 +147,7 @@ IdentityStore.prototype.addUnconfirmedTransaction = function(txParams, cb){ var time = (new Date()).getTime() var txId = createId() txParams.metamaskId = txId + txParams.metamaskNetworkId = this._currentState.network var txData = { id: txId, txParams: txParams, |