mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-04-02 00:52:13 +02:00
contractcourt: add locks in SubscribeChannelEvents
This commit is contained in:
parent
07466c4f8c
commit
c644deb49f
@ -1223,7 +1223,10 @@ func (c *ChainArbitrator) SubscribeChannelEvents(
|
||||
|
||||
// First, we'll attempt to look up the active watcher for this channel.
|
||||
// If we can't find it, then we'll return an error back to the caller.
|
||||
c.Lock()
|
||||
watcher, ok := c.activeWatchers[chanPoint]
|
||||
c.Unlock()
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unable to find watcher for: %v",
|
||||
chanPoint)
|
||||
|
Loading…
x
Reference in New Issue
Block a user