diff --git a/chainntnfs/bitcoindnotify/bitcoind.go b/chainntnfs/bitcoindnotify/bitcoind.go index 8bcf8872b..91c38d8d6 100644 --- a/chainntnfs/bitcoindnotify/bitcoind.go +++ b/chainntnfs/bitcoindnotify/bitcoind.go @@ -665,8 +665,14 @@ func (b *BitcoindNotifier) handleBlockConnected(block chainntnfs.BlockEpoch) err // satisfy any client requests based upon the new block. b.bestBlock = block + err = b.txNotifier.NotifyHeight(uint32(block.Height)) + if err != nil { + return fmt.Errorf("unable to notify height: %w", err) + } + b.notifyBlockEpochs(block.Height, block.Hash, block.BlockHeader) - return b.txNotifier.NotifyHeight(uint32(block.Height)) + + return nil } // notifyBlockEpochs notifies all registered block epoch clients of the newly diff --git a/chainntnfs/btcdnotify/btcd.go b/chainntnfs/btcdnotify/btcd.go index bcbfa571a..ff91b5aee 100644 --- a/chainntnfs/btcdnotify/btcd.go +++ b/chainntnfs/btcdnotify/btcd.go @@ -725,11 +725,16 @@ func (b *BtcdNotifier) handleBlockConnected(epoch chainntnfs.BlockEpoch) error { // satisfy any client requests based upon the new block. b.bestBlock = epoch + err = b.txNotifier.NotifyHeight(uint32(epoch.Height)) + if err != nil { + return fmt.Errorf("unable to notify height: %w", err) + } + b.notifyBlockEpochs( epoch.Height, epoch.Hash, epoch.BlockHeader, ) - return b.txNotifier.NotifyHeight(uint32(epoch.Height)) + return nil } // notifyBlockEpochs notifies all registered block epoch clients of the newly diff --git a/chainntnfs/neutrinonotify/neutrino.go b/chainntnfs/neutrinonotify/neutrino.go index 55d923577..7b93bcd80 100644 --- a/chainntnfs/neutrinonotify/neutrino.go +++ b/chainntnfs/neutrinonotify/neutrino.go @@ -689,10 +689,16 @@ func (n *NeutrinoNotifier) handleBlockConnected(newBlock *filteredBlock) error { n.bestBlock.Height = int32(newBlock.height) n.bestBlock.BlockHeader = newBlock.header + err = n.txNotifier.NotifyHeight(newBlock.height) + if err != nil { + return fmt.Errorf("unable to notify height: %w", err) + } + n.notifyBlockEpochs( int32(newBlock.height), &newBlock.hash, newBlock.header, ) - return n.txNotifier.NotifyHeight(newBlock.height) + + return nil } // getFilteredBlock is a utility to retrieve the full filtered block from a block epoch.