aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/transactions/index.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-06-13 04:07:19 +0800
committerGitHub <noreply@github.com>2018-06-13 04:07:19 +0800
commit0740dd6a5b89defd5f5ba27fa38c7004243f0ce2 (patch)
tree6643b1457d2e9ef0961c434a885c0c53f0cb9548 /app/scripts/controllers/transactions/index.js
parent77dc75c9b1889699fe44db1fbcda4587d58bd665 (diff)
parent604289c96cde7e5f4634fe5e76a50dfa9174fcbd (diff)
downloadtangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.tar
tangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.tar.gz
tangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.tar.bz2
tangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.tar.lz
tangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.tar.xz
tangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.tar.zst
tangerine-wallet-browser-0740dd6a5b89defd5f5ba27fa38c7004243f0ce2.zip
Merge pull request #4557 from MetaMask/nonce-tracker-mutex-fix
Bug: Mutex locks not released on error
Diffstat (limited to 'app/scripts/controllers/transactions/index.js')
-rw-r--r--app/scripts/controllers/transactions/index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index b53947e27..8e2288aed 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -165,7 +165,7 @@ class TransactionController extends EventEmitter {
// add default tx params
txMeta = await this.addTxGasDefaults(txMeta)
} catch (error) {
- console.log(error)
+ log.warn(error)
this.txStateManager.setTxStatusFailed(txMeta.id, error)
throw error
}
@@ -264,7 +264,12 @@ class TransactionController extends EventEmitter {
// must set transaction to submitted/failed before releasing lock
nonceLock.releaseLock()
} catch (err) {
- this.txStateManager.setTxStatusFailed(txId, err)
+ // this is try-catch wrapped so that we can guarantee that the nonceLock is released
+ try {
+ this.txStateManager.setTxStatusFailed(txId, err)
+ } catch (err) {
+ log.error(err)
+ }
// must set transaction to submitted/failed before releasing lock
if (nonceLock) nonceLock.releaseLock()
// continue with error chain