From f29b496b7697e3bd5ae8dcbdba00f4d7c0fcbfa1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 15 Dec 2016 13:53:36 -0800 Subject: [PATCH] chainntfns/btcdnotify: close channels for all epoch clients on shutdown This commit modifies the Stop method of the default ChainNotifier client, the BtcdNotifier. We now close the notificaiton channel for all the currently active block epoch clients in order to give clients a signal that the entire daemon and possibly the ChainNotifier is shutting down. This gives clients an extra signal to more thoroughly implement a graceful shutdown across the daemon. --- chainntnfs/btcdnotify/btcd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chainntnfs/btcdnotify/btcd.go b/chainntnfs/btcdnotify/btcd.go index 43e05a6cc..d0c89b080 100644 --- a/chainntnfs/btcdnotify/btcd.go +++ b/chainntnfs/btcdnotify/btcd.go @@ -159,6 +159,9 @@ func (b *BtcdNotifier) Stop() error { close(confClient.negativeConf) } } + for _, epochClient := range b.blockEpochClients { + close(epochClient) + } return nil }