fundingmgr: check quit channel when sending update
Avoids deadlock during failing fundingmanager tests.
This commit is contained in:
parent
4c15353116
commit
0c65719613
@ -1617,7 +1617,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
|||||||
// is over.
|
// is over.
|
||||||
// TODO(roasbeef): add abstraction over updates to accommodate
|
// TODO(roasbeef): add abstraction over updates to accommodate
|
||||||
// long-polling, or SSE, etc.
|
// long-polling, or SSE, etc.
|
||||||
resCtx.updates <- &lnrpc.OpenStatusUpdate{
|
upd := &lnrpc.OpenStatusUpdate{
|
||||||
Update: &lnrpc.OpenStatusUpdate_ChanPending{
|
Update: &lnrpc.OpenStatusUpdate_ChanPending{
|
||||||
ChanPending: &lnrpc.PendingUpdate{
|
ChanPending: &lnrpc.PendingUpdate{
|
||||||
Txid: fundingPoint.Hash[:],
|
Txid: fundingPoint.Hash[:],
|
||||||
@ -1626,6 +1626,12 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
case resCtx.updates <- upd:
|
||||||
|
case <-f.quit:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// At this point we have broadcast the funding transaction and done all
|
// At this point we have broadcast the funding transaction and done all
|
||||||
// necessary processing.
|
// necessary processing.
|
||||||
f.wg.Add(1)
|
f.wg.Add(1)
|
||||||
@ -1693,7 +1699,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
|||||||
// Give the caller a final update notifying them that
|
// Give the caller a final update notifying them that
|
||||||
// the channel is now open.
|
// the channel is now open.
|
||||||
// TODO(roasbeef): only notify after recv of funding locked?
|
// TODO(roasbeef): only notify after recv of funding locked?
|
||||||
resCtx.updates <- &lnrpc.OpenStatusUpdate{
|
upd := &lnrpc.OpenStatusUpdate{
|
||||||
Update: &lnrpc.OpenStatusUpdate_ChanOpen{
|
Update: &lnrpc.OpenStatusUpdate_ChanOpen{
|
||||||
ChanOpen: &lnrpc.ChannelOpenUpdate{
|
ChanOpen: &lnrpc.ChannelOpenUpdate{
|
||||||
ChannelPoint: &lnrpc.ChannelPoint{
|
ChannelPoint: &lnrpc.ChannelPoint{
|
||||||
@ -1706,6 +1712,12 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
case resCtx.updates <- upd:
|
||||||
|
case <-f.quit:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
err = f.annAfterSixConfs(completeChan, shortChanID)
|
err = f.annAfterSixConfs(completeChan, shortChanID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fndgLog.Errorf("failed sending channel announcement: %v",
|
fndgLog.Errorf("failed sending channel announcement: %v",
|
||||||
|
Loading…
Reference in New Issue
Block a user