aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/transactions.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-07-19 06:27:15 +0800
committerkumavis <aaron@kumavis.me>2017-07-19 06:27:15 +0800
commit12d6f2162791b421bd51313b0063e144b47ed868 (patch)
tree079d48fff6729abd6689a10badaf99bc36230220 /app/scripts/controllers/transactions.js
parentaa48ed34c458874914c44400fb68885069625a6f (diff)
downloadtangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.tar
tangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.tar.gz
tangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.tar.bz2
tangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.tar.lz
tangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.tar.xz
tangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.tar.zst
tangerine-wallet-browser-12d6f2162791b421bd51313b0063e144b47ed868.zip
transactions - block nonce-tracker while updating pending transactions
Diffstat (limited to 'app/scripts/controllers/transactions.js')
-rw-r--r--app/scripts/controllers/transactions.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 1fc48aadd..5f3d84ebe 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -484,12 +484,15 @@ module.exports = class TransactionController extends EventEmitter {
// if confirmed sets the tx status as 'confirmed'
async _checkPendingTxs () {
const signedTxList = this.getFilteredTxList({status: 'submitted'})
+ // in order to keep the nonceTracker accurate we block it while updating pending transactions
+ const nonceGlobalLock = await this.nonceTracker.getGlobalLock()
try {
await Promise.all(signedTxList.map((txMeta) => this._checkPendingTx(txMeta)))
} catch (err) {
console.error('TransactionController - Error updating pending transactions')
console.error(err)
}
+ nonceGlobalLock.releaseLock()
}
async _checkPendingTx (txMeta) {