aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-state-manager.js
diff options
context:
space:
mode:
authorThomas <tmashuang@gmail.com>2018-03-10 07:01:48 +0800
committerThomas <tmashuang@gmail.com>2018-03-10 07:01:48 +0800
commitd5b1d6182ba73b28efd6862034038156c3e596c1 (patch)
tree8bebaedc1f9c95bb2d17b12be2fd16d50f75ad0f /app/scripts/lib/tx-state-manager.js
parent0db4ba1086f56422752dd4b9e3754a273d23a866 (diff)
parent634e5d8f55efc6c307a867556116a565eee21b58 (diff)
downloadtangerine-wallet-browser-d5b1d6182ba73b28efd6862034038156c3e596c1.tar.gz
tangerine-wallet-browser-d5b1d6182ba73b28efd6862034038156c3e596c1.tar.zst
tangerine-wallet-browser-d5b1d6182ba73b28efd6862034038156c3e596c1.zip
Merge branch 'master' into selenium-e2e
Diffstat (limited to 'app/scripts/lib/tx-state-manager.js')
-rw-r--r--app/scripts/lib/tx-state-manager.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index a8ef39891..2eb006380 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/app/scripts/lib/tx-state-manager.js
@@ -4,7 +4,7 @@ const ObservableStore = require('obs-store')
const ethUtil = require('ethereumjs-util')
const txStateHistoryHelper = require('./tx-state-history-helper')
-module.exports = class TransactionStateManger extends EventEmitter {
+module.exports = class TransactionStateManager extends EventEmitter {
constructor ({ initState, txHistoryLimit, getNetwork }) {
super()
@@ -221,6 +221,17 @@ module.exports = class TransactionStateManger extends EventEmitter {
this._setTxStatus(txId, 'failed')
}
+ wipeTransactions (address) {
+ // network only tx
+ const txs = this.getFullTxList()
+ const network = this.getNetwork()
+
+ // Filter out the ones from the current account and network
+ const otherAccountTxs = txs.filter((txMeta) => !(txMeta.txParams.from === address && txMeta.metamaskNetworkId === network))
+
+ // Update state
+ this._saveTxList(otherAccountTxs)
+ }
//
// PRIVATE METHODS
//