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