pool: minor.
This commit is contained in:
parent
be4145e163
commit
545c0004e9
@ -124,7 +124,7 @@ function Peer(options) {
|
||||
this.lastPong = -1;
|
||||
this.lastPing = -1;
|
||||
this.minPing = -1;
|
||||
this.lastBlock = -1;
|
||||
this.blockTime = -1;
|
||||
|
||||
this.connectTimeout = null;
|
||||
this.pingTimer = null;
|
||||
@ -1248,7 +1248,7 @@ Peer.prototype.maybeTimeout = function maybeTimeout() {
|
||||
}
|
||||
|
||||
if (this.syncing && this.loader && !this.options.isFull()) {
|
||||
if (now > this.lastBlock + Peer.BLOCK_TIMEOUT) {
|
||||
if (now > this.blockTime + Peer.BLOCK_TIMEOUT) {
|
||||
this.error('Peer is stalling (block).');
|
||||
this.destroy();
|
||||
return;
|
||||
|
||||
@ -621,8 +621,7 @@ Pool.prototype.sendSync = co(function* sendSync(peer) {
|
||||
}
|
||||
|
||||
peer.syncing = true;
|
||||
|
||||
peer.lastBlock = util.ms();
|
||||
peer.blockTime = util.ms();
|
||||
|
||||
if (this.headersFirst) {
|
||||
tip = this.chain.tip;
|
||||
@ -1944,7 +1943,7 @@ Pool.prototype._addBlock = co(function* addBlock(peer, block) {
|
||||
if (node.height === this.headerTip.height) {
|
||||
this.logger.info(
|
||||
'Received checkpoint block %s (%d).',
|
||||
hash, node.height);
|
||||
block.rhash(), node.height);
|
||||
isWatermark = true;
|
||||
} else {
|
||||
this.headerChain.shift();
|
||||
@ -1952,7 +1951,7 @@ Pool.prototype._addBlock = co(function* addBlock(peer, block) {
|
||||
}
|
||||
}
|
||||
|
||||
peer.lastBlock = util.ms();
|
||||
peer.blockTime = util.ms();
|
||||
|
||||
try {
|
||||
yield this.chain.add(block);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user