chain: cleanup function names.
This commit is contained in:
parent
2358784d43
commit
b2c02a7052
@ -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;
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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]);
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user