Skip to content

Commit

Permalink
chain: use mutex at stop
Browse files Browse the repository at this point in the history
  • Loading branch information
bullet-tooth committed Dec 13, 2024
1 parent c492b75 commit 06b6f33
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 06b6f33

Please sign in to comment.