From 333ecbf262d6d3617a7c42103883bc6d7a6b63e3 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Mon, 9 Sep 2019 17:10:38 +0300 Subject: [PATCH] chain: notify block when not filtered for BitcoindClient --- chain/bitcoind_client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chain/bitcoind_client.go b/chain/bitcoind_client.go index 0da4776..a8bcc1e 100644 --- a/chain/bitcoind_client.go +++ b/chain/bitcoind_client.go @@ -1152,7 +1152,14 @@ func (c *BitcoindClient) filterBlock(block *wire.MsgBlock, height int32, // If this block happened before the client's birthday or we have // nothing to filter for, then we'll skip it entirely. + blockHash := block.BlockHash() if !c.shouldFilterBlock(block.Header.Timestamp) { + if notify { + c.onFilteredBlockConnected(height, &block.Header, nil) + c.onBlockConnected( + &blockHash, height, block.Header.Timestamp, + ) + } return nil } @@ -1163,7 +1170,6 @@ func (c *BitcoindClient) filterBlock(block *wire.MsgBlock, height int32, // Create a block details template to use for all of the confirmed // transactions found within this block. - blockHash := block.BlockHash() blockDetails := &btcjson.BlockDetails{ Hash: blockHash.String(), Height: height,