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:
Matt Morehouse committed 2022-09-19 10:55:45 -05:00
1 parent 202fcd6672
commit 54474d5cd7
1 file changed
+2
+2
View File
@@ -634,7 +634,9 @@ func (f *Manager) start() error {
f.newChanBarriers[chanID] = make(chan struct{})
f.barrierMtx.Unlock()
f.localDiscoveryMtx.Lock()
f.localDiscoverySignals[chanID] = make(chan struct{})
f.localDiscoveryMtx.Unlock()
// Rebroadcast the funding transaction for any pending
// channel that we initiated. No error will be returned