diff --git a/chainntnfs/txnotifier.go b/chainntnfs/txnotifier.go index 654b757e..ad81aba0 100644 --- a/chainntnfs/txnotifier.go +++ b/chainntnfs/txnotifier.go @@ -1912,11 +1912,11 @@ func (n *TxNotifier) dispatchSpendReorg(ntfn *SpendNtfn) error { // closes the event channels of all registered notifications that have not been // dispatched yet. func (n *TxNotifier) TearDown() { + close(n.quit) + n.Lock() defer n.Unlock() - close(n.quit) - for _, confSet := range n.confNotifications { for _, ntfn := range confSet.ntfns { close(ntfn.Event.Confirmed)