diff --git a/chainntnfs/bitcoindnotify/bitcoind.go b/chainntnfs/bitcoindnotify/bitcoind.go index 7dc471701..d3c197228 100644 --- a/chainntnfs/bitcoindnotify/bitcoind.go +++ b/chainntnfs/bitcoindnotify/bitcoind.go @@ -278,14 +278,19 @@ out: return } - if confDetails != nil { - err := b.txConfNotifier.UpdateConfDetails( - *msg.TxID, msg.ConfID, - confDetails, - ) - if err != nil { - chainntnfs.Log.Error(err) - } + // If the historical dispatch finished + // without error, we will invoke + // UpdateConfDetails even if none were + // found. This allows the notifier to + // begin safely updating the height hint + // cache at tip, since any pending + // rescans have now completed. + err = b.txConfNotifier.UpdateConfDetails( + *msg.TxID, msg.ConfID, + confDetails, + ) + if err != nil { + chainntnfs.Log.Error(err) } }() diff --git a/chainntnfs/btcdnotify/btcd.go b/chainntnfs/btcdnotify/btcd.go index 209b97445..968a6c352 100644 --- a/chainntnfs/btcdnotify/btcd.go +++ b/chainntnfs/btcdnotify/btcd.go @@ -348,14 +348,19 @@ out: return } - if confDetails != nil { - err = b.txConfNotifier.UpdateConfDetails( - *msg.TxID, msg.ConfID, - confDetails, - ) - if err != nil { - chainntnfs.Log.Error(err) - } + // If the historical dispatch finished + // without error, we will invoke + // UpdateConfDetails even if none were + // found. This allows the notifier to + // begin safely updating the height hint + // cache at tip, since any pending + // rescans have now completed. + err = b.txConfNotifier.UpdateConfDetails( + *msg.TxID, msg.ConfID, + confDetails, + ) + if err != nil { + chainntnfs.Log.Error(err) } }() diff --git a/chainntnfs/neutrinonotify/neutrino.go b/chainntnfs/neutrinonotify/neutrino.go index f410b7b86..9f76b14a8 100644 --- a/chainntnfs/neutrinonotify/neutrino.go +++ b/chainntnfs/neutrinonotify/neutrino.go @@ -353,14 +353,22 @@ out: chainntnfs.Log.Error(err) } + // If the historical dispatch finished + // without error, we will invoke + // UpdateConfDetails even if none were + // found. This allows the notifier to + // begin safely updating the height hint + // cache at tip, since any pending + // rescans have now completed. + err = n.txConfNotifier.UpdateConfDetails( + *msg.TxID, msg.ConfID, + confDetails, + ) + if err != nil { + chainntnfs.Log.Error(err) + } + if confDetails != nil { - err := n.txConfNotifier.UpdateConfDetails( - *msg.TxID, msg.ConfID, - confDetails, - ) - if err != nil { - chainntnfs.Log.Error(err) - } return }