diff --git a/lib/bcoin/lowlevelup.js b/lib/bcoin/lowlevelup.js index 37796b47..8eb65582 100644 --- a/lib/bcoin/lowlevelup.js +++ b/lib/bcoin/lowlevelup.js @@ -423,7 +423,7 @@ VERSION_ERROR = 'Warning:' + ' format has changed drastically. If you want to dump your' + ' data, downgrade to your previous version first. If you do' + ' not think you should be seeing this error, post an issue on' - + ' the repo.' + + ' the repo.'; /* * Expose diff --git a/lib/bcoin/mempool.js b/lib/bcoin/mempool.js index bb6cd278..90582f9c 100644 --- a/lib/bcoin/mempool.js +++ b/lib/bcoin/mempool.js @@ -652,7 +652,6 @@ Mempool.prototype.has = function has(hash, callback) { Mempool.prototype.addTX = function addTX(tx, callback, force) { var self = this; - var flags = constants.flags.STANDARD_VERIFY_FLAGS; var lockFlags = constants.flags.STANDARD_LOCKTIME_FLAGS; var hash = tx.hash('hex'); var ret = {}; diff --git a/lib/bcoin/rbt.js b/lib/bcoin/rbt.js index efb16fe8..ab931cd6 100644 --- a/lib/bcoin/rbt.js +++ b/lib/bcoin/rbt.js @@ -663,9 +663,6 @@ RBT.prototype.put = function put(key, value, options, callback) { options = null; } - if (!options) - options = {}; - this.insert(key, value); return utils.nextTick(callback); @@ -684,9 +681,6 @@ RBT.prototype.del = function del(key, options, callback) { options = null; } - if (!options) - options = {}; - this.remove(key); return utils.nextTick(callback); diff --git a/lib/bcoin/sigcache.js b/lib/bcoin/sigcache.js index afe75468..47fbc225 100644 --- a/lib/bcoin/sigcache.js +++ b/lib/bcoin/sigcache.js @@ -43,7 +43,7 @@ function SigCache(size) { */ SigCache.prototype.add = function add(hash, sig, key) { - var index, key; + var i, k; if (this.size === 0) return; @@ -51,10 +51,10 @@ SigCache.prototype.add = function add(hash, sig, key) { this.valid[hash] = new SigCacheEntry(sig, key); if (this.keys.length === this.size) { - index = Math.floor(Math.random() * this.keys.length); - key = this.keys[index]; - delete this.valid[key]; - this.keys[index] = hash; + i = Math.floor(Math.random() * this.keys.length); + k = this.keys[i]; + delete this.valid[k]; + this.keys[i] = hash; } else { this.keys.push(hash); }