diff --git a/chain/bitcoind_conn.go b/chain/bitcoind_conn.go index 9c1f1e3c78..33b4f0e9e2 100644 --- a/chain/bitcoind_conn.go +++ b/chain/bitcoind_conn.go @@ -238,7 +238,8 @@ func (c *BitcoindConn) Stop() { if !atomic.CompareAndSwapInt32(&c.stopped, 0, 1) { return } - + c.subscriptionsMtx.Lock() + defer c.subscriptionsMtx.Unlock() for subscription := range c.subscriptions { close(subscription.txNtfns) close(subscription.blockNtfns)