mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
peer: allow msgStream goroutines to quit within the apply function
In this commit, we thread through the quit of the peer to the execution of the apply function for a msgStream. This change ensures that if the target is still processing the message, then the peer is able to exit cleanly and not block insensately.
This commit is contained in:
parent
0b5a403fce
commit
33c5c9661e
1 changed files with 3 additions and 1 deletions
4
peer.go
4
peer.go
|
@ -836,7 +836,9 @@ func newChanMsgStream(p *peer, cid lnwire.ChannelID) *msgStream {
|
|||
// to the other side, they immediately send a
|
||||
// channel update message, but we haven't yet
|
||||
// sent the channel to the channelManager.
|
||||
p.server.fundingMgr.waitUntilChannelOpen(cid)
|
||||
p.server.fundingMgr.waitUntilChannelOpen(
|
||||
cid, p.quit,
|
||||
)
|
||||
}
|
||||
|
||||
// TODO(roasbeef): only wait if not chan sync
|
||||
|
|
Loading…
Add table
Reference in a new issue