diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-08-23 10:23:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 10:23:01 +0800 |
commit | c97866e367a3e28b5b91a0e5e3a1d1befa652f13 (patch) | |
tree | ac10b0350dbcb5cfcd2f708503d478eb18a2b739 /app | |
parent | 8b9999b71eab07187e2723aadcc8163140985301 (diff) | |
parent | 07927b57986ffb0035b6b30ae7e54b843b551d83 (diff) | |
download | tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.tar tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.tar.gz tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.tar.bz2 tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.tar.lz tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.tar.xz tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.tar.zst tangerine-wallet-browser-c97866e367a3e28b5b91a0e5e3a1d1befa652f13.zip |
Merge branch 'master' into kumavis-patch-1
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) } |