Merge pull request #644 from wpaulino/notify-on-not-filtered
chain: notify block when not filtered for BitcoindClient
This commit is contained in:
commit
d5cdeb4b91
1 changed files with 7 additions and 1 deletions
|
@ -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
|
// If this block happened before the client's birthday or we have
|
||||||
// nothing to filter for, then we'll skip it entirely.
|
// nothing to filter for, then we'll skip it entirely.
|
||||||
|
blockHash := block.BlockHash()
|
||||||
if !c.shouldFilterBlock(block.Header.Timestamp) {
|
if !c.shouldFilterBlock(block.Header.Timestamp) {
|
||||||
|
if notify {
|
||||||
|
c.onFilteredBlockConnected(height, &block.Header, nil)
|
||||||
|
c.onBlockConnected(
|
||||||
|
&blockHash, height, block.Header.Timestamp,
|
||||||
|
)
|
||||||
|
}
|
||||||
return nil
|
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
|
// Create a block details template to use for all of the confirmed
|
||||||
// transactions found within this block.
|
// transactions found within this block.
|
||||||
blockHash := block.BlockHash()
|
|
||||||
blockDetails := &btcjson.BlockDetails{
|
blockDetails := &btcjson.BlockDetails{
|
||||||
Hash: blockHash.String(),
|
Hash: blockHash.String(),
|
||||||
Height: height,
|
Height: height,
|
||||||
|
|
Loading…
Reference in a new issue