aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/config-manager.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-08-24 05:51:09 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-08-24 05:51:09 +0800
commit4bceda37a8dfa414d4e5ff2b315b9968120d0d37 (patch)
tree4ed708d8f1db35b5373389b7c005ff2b9bfc4807 /app/scripts/lib/config-manager.js
parent00e8db31cebaf7af42660e828cc912b2b6af5b5d (diff)
parent9dad3a5917308cb6d9ee56aa183298b8eaad1c5f (diff)
downloadtangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.tar
tangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.tar.gz
tangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.tar.bz2
tangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.tar.lz
tangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.tar.xz
tangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.tar.zst
tangerine-wallet-browser-4bceda37a8dfa414d4e5ff2b315b9968120d0d37.zip
Merge branch 'master' into fox-sub
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r--app/scripts/lib/config-manager.js6
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)
}