peer: refactor cmpctblock handling.

This commit is contained in:
Christopher Jeffrey 2016-11-17 16:51:21 -08:00
parent aba22e24d7
commit d96a579665
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -2181,12 +2181,9 @@ Peer.prototype._handleCmpctBlock = co(function* _handleCmpctBlock(packet) {
return;
}
this.compactBlocks[hash] = block;
result = block.fillMempool(this.options.witness, this.mempool);
if (result) {
delete this.compactBlocks[hash];
this.fire('block', block.toBlock());
this.logger.debug(
'Received full compact block %s (%s).',
@ -2194,6 +2191,8 @@ Peer.prototype._handleCmpctBlock = co(function* _handleCmpctBlock(packet) {
return;
}
this.compactBlocks[hash] = block;
yield this.send(new packets.GetBlockTxnPacket(block.toRequest()));
this.logger.debug(