funding: fix potential data race
localDiscoverySignals needs to be guarded by its mutex. I was unable to write a test case that would trigger a race under the race detector, but better safe than sorry.
This commit is contained in:
1 file changed
+2
@@ -634,7 +634,9 @@ func (f *Manager) start() error {
|
|||||||
f.newChanBarriers[chanID] = make(chan struct{})
|
f.newChanBarriers[chanID] = make(chan struct{})
|
||||||
f.barrierMtx.Unlock()
|
f.barrierMtx.Unlock()
|
||||||
|
|
||||||
|
f.localDiscoveryMtx.Lock()
|
||||||
f.localDiscoverySignals[chanID] = make(chan struct{})
|
f.localDiscoverySignals[chanID] = make(chan struct{})
|
||||||
|
f.localDiscoveryMtx.Unlock()
|
||||||
|
|
||||||
// Rebroadcast the funding transaction for any pending
|
// Rebroadcast the funding transaction for any pending
|
||||||
// channel that we initiated. No error will be returned
|
// channel that we initiated. No error will be returned
|
||||||
|
|||||||
Reference in new issue
Block a user