Skip to content

Commit

Permalink
use mutex at stop
Browse files Browse the repository at this point in the history
  • Loading branch information
bullet-tooth committed Nov 21, 2024
1 parent d77fcba commit 9c0adae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chain/bitcoind_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9c0adae

Please sign in to comment.