peer: refactor cmpctblock handling.
This commit is contained in:
parent
aba22e24d7
commit
d96a579665
@ -2181,12 +2181,9 @@ Peer.prototype._handleCmpctBlock = co(function* _handleCmpctBlock(packet) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.compactBlocks[hash] = block;
|
|
||||||
|
|
||||||
result = block.fillMempool(this.options.witness, this.mempool);
|
result = block.fillMempool(this.options.witness, this.mempool);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
delete this.compactBlocks[hash];
|
|
||||||
this.fire('block', block.toBlock());
|
this.fire('block', block.toBlock());
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
'Received full compact block %s (%s).',
|
'Received full compact block %s (%s).',
|
||||||
@ -2194,6 +2191,8 @@ Peer.prototype._handleCmpctBlock = co(function* _handleCmpctBlock(packet) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.compactBlocks[hash] = block;
|
||||||
|
|
||||||
yield this.send(new packets.GetBlockTxnPacket(block.toRequest()));
|
yield this.send(new packets.GetBlockTxnPacket(block.toRequest()));
|
||||||
|
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user