diff --git a/lib/chain/chain.js b/lib/chain/chain.js index cf447400..7333f344 100644 --- a/lib/chain/chain.js +++ b/lib/chain/chain.js @@ -707,7 +707,7 @@ Chain.prototype.verifyInputs = co(function* verifyInputs(block, prev, state) { * @returns {Number} */ -Chain.prototype._getCachedHeight = function _getCachedHeight(hash) { +Chain.prototype.checkHeight = function checkHeight(hash) { if (this.db.hasCache(hash)) return this.db.getCache(hash).height; diff --git a/lib/chain/chaindb.js b/lib/chain/chaindb.js index 9f9184e7..f20dddd5 100644 --- a/lib/chain/chaindb.js +++ b/lib/chain/chaindb.js @@ -374,16 +374,6 @@ ChainDB.prototype.commit = co(function* commit() { this.cacheHeight.commit(); }); -/** - * Add an entry to the LRU cache. - * @param {ChainEntry} entry - */ - -ChainDB.prototype.addCache = function addCache(entry) { - this.cacheHash.set(entry.hash, entry); - this.cacheHeight.set(entry.height, entry); -}; - /** * Test the cache for a present entry hash or height. * @param {Hash|Number} hash - Hash or height. diff --git a/lib/net/peer.js b/lib/net/peer.js index ac18d181..3b35d4a3 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -2286,7 +2286,7 @@ Peer.prototype.sendGetHeaders = function sendGetHeaders(locator, stop) { this.hostname); if (packet.locator.length > 0) { - height = this.chain._getCachedHeight(packet.locator[0]); + height = this.chain.checkHeight(packet.locator[0]); hash = utils.revHex(packet.locator[0]); } @@ -2314,7 +2314,7 @@ Peer.prototype.sendGetBlocks = function getBlocks(locator, stop) { this.hostname); if (packet.locator.length > 0) { - height = this.chain._getCachedHeight(packet.locator[0]); + height = this.chain.checkHeight(packet.locator[0]); hash = utils.revHex(packet.locator[0]); } diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 97a81703..009132ca 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -541,11 +541,11 @@ WalletDB.prototype.wipe = co(function* wipe() { } // All block records (c -- old) - gte = new Buffer(33); + gte = new Buffer(5); gte.fill(0); gte[0] = 0x63; - lte = new Buffer(33); + lte = new Buffer(5); lte.fill(255); lte[0] = 0x63;