chain: cleanup function names.

This commit is contained in:
Christopher Jeffrey 2016-11-02 04:02:01 -07:00
parent 2358784d43
commit b2c02a7052
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
4 changed files with 5 additions and 15 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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]);
}

View File

@ -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;