chaindb: minor.
This commit is contained in:
parent
72b68532e3
commit
f45ce12bec
@ -83,17 +83,14 @@ function ChainDB(chain) {
|
||||
this.cacheWindow = (this.network.pow.retargetInterval + 1) * 2 + 100;
|
||||
|
||||
// We want to keep the last 5 blocks of unspents in memory.
|
||||
this.coinWindow = 0;
|
||||
this.coinWindow = chain.options.coinCache || 0;
|
||||
|
||||
this.coinCache = new LRU.Nil();
|
||||
this.cacheHash = new LRU(this.cacheWindow);
|
||||
this.cacheHeight = new LRU(this.cacheWindow);
|
||||
|
||||
if (chain.options.coinCache) {
|
||||
assert(typeof chain.options.coinCache === 'number');
|
||||
this.coinWindow = chain.options.coinCache;
|
||||
if (this.coinWindow)
|
||||
this.coinCache = new LRU(this.coinWindow, getSize);
|
||||
}
|
||||
}
|
||||
|
||||
util.inherits(ChainDB, AsyncObject);
|
||||
|
||||
@ -850,7 +850,7 @@ Pool.prototype._handleBlocks = co(function* _handleBlocks(hashes, peer) {
|
||||
// hash.
|
||||
this.logger.debug('Received known orphan hash (%s).', peer.hostname);
|
||||
yield peer.resolveOrphan(null, hash);
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
exists = yield this.getBlock(peer, hash);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user