aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2018-05-23 07:40:01 +0800
committerfrankiebee <frankie.diamond@gmail.com>2018-05-23 07:40:01 +0800
commit10aecf49227098fb7fdbd7db193a9dcc6fecf5af (patch)
tree1bb0ec9fec19e67725e6ceb356059f7485b326c3 /app
parent60bc28bf3c75135bd751852e32ff98b7b6181249 (diff)
downloadtangerine-wallet-browser-10aecf49227098fb7fdbd7db193a9dcc6fecf5af.tar.gz
tangerine-wallet-browser-10aecf49227098fb7fdbd7db193a9dcc6fecf5af.tar.zst
tangerine-wallet-browser-10aecf49227098fb7fdbd7db193a9dcc6fecf5af.zip
remove dependance on the even tx:confirmed
Diffstat (limited to 'app')
-rw-r--r--app/scripts/controllers/transactions/index.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index cb3d28f1d..313b20675 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -57,6 +57,7 @@ class TransactionController extends EventEmitter {
initState: opts.initState,
txHistoryLimit: opts.txHistoryLimit,
getNetwork: this.getNetwork.bind(this),
+ confirmTransaction: this.confirmTransaction.bind(this),
})
this._onBootCleanUp()
@@ -316,6 +317,11 @@ class TransactionController extends EventEmitter {
this.txStateManager.setTxStatusSubmitted(txId)
}
+ confirmTransaction (txId) {
+ this.txStateManager.setTxStatusConfirmed(txId)
+ this._markNonceDuplicatesDropped(txId)
+ }
+
/**
Convenience method for the ui thats sets the transaction to rejected
@param txId {number} - the tx's Id
@@ -396,8 +402,6 @@ class TransactionController extends EventEmitter {
this.pendingTxTracker.on('tx:warning', (txMeta) => {
this.txStateManager.updateTx(txMeta, 'transactions/pending-tx-tracker#event: tx:warning')
})
- this.pendingTxTracker.on('tx:confirmed', (txId) => this.txStateManager.setTxStatusConfirmed(txId))
- this.pendingTxTracker.on('tx:confirmed', (txId) => this._markNonceDuplicatesDropped(txId))
this.pendingTxTracker.on('tx:failed', this.txStateManager.setTxStatusFailed.bind(this.txStateManager))
this.pendingTxTracker.on('tx:block-update', (txMeta, latestBlockNumber) => {
if (!txMeta.firstRetryBlockNumber) {