From d96a579665a29fad7e65347d2ff74e52ee1b0cb4 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 17 Nov 2016 16:51:21 -0800 Subject: [PATCH] peer: refactor cmpctblock handling. --- lib/net/peer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/net/peer.js b/lib/net/peer.js index cc1b7a37..ff668bb2 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -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(