diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-08-23 10:22:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 10:22:31 +0800 |
commit | 07927b57986ffb0035b6b30ae7e54b843b551d83 (patch) | |
tree | 5e11c75a4b1fdbb6d2d351c4ab9f1f50c8b45cb1 /app | |
parent | f9c58c07466d181a895cd38b1c3049a11e02cb99 (diff) | |
parent | 5c9ca21ba3224fd54430a3c518b825ff6cd112f3 (diff) | |
download | tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.tar tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.tar.gz tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.tar.bz2 tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.tar.lz tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.tar.xz tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.tar.zst tangerine-wallet-browser-07927b57986ffb0035b6b30ae7e54b843b551d83.zip |
Merge pull request #558 from MetaMask/i390-TransactionLimit
Enforce transaction log limit
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/config-manager.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 6f5cb3a4a..4d270bcdb 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -5,6 +5,7 @@ const rp = require('request-promise') const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet +const txLimit = 40 /* The config-manager is a convenience object * wrapping a pojo-migrator. @@ -15,6 +16,8 @@ const MAINNET_RPC = MetamaskConfig.network.mainnet */ module.exports = ConfigManager function ConfigManager (opts) { + this.txLimit = txLimit + // ConfigManager is observable and will emit updates this._subs = [] @@ -181,6 +184,9 @@ ConfigManager.prototype._saveTxList = function (txList) { ConfigManager.prototype.addTx = function (tx) { var transactions = this.getTxList() + while (transactions.length > this.txLimit - 1) { + transactions.shift() + } transactions.push(tx) this._saveTxList(transactions) } |