htlcswitch: fix HandleChannelUpdate by selecting on link's quit chan

This commit is contained in:
yyforyongyu 2023-02-16 13:25:53 +08:00
parent 7a3b3c89c2
commit 53fa13bc29
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -2743,6 +2743,15 @@ func (l *channelLink) handleSwitchPacket(pkt *htlcPacket) error {
//
// NOTE: Part of the ChannelLink interface.
func (l *channelLink) HandleChannelUpdate(message lnwire.Message) {
select {
case <-l.quit:
// Return early if the link is already in the process of
// quitting. It doesn't make sense to hand the message to the
// mailbox here.
return
default:
}
l.mailBox.AddMessage(message)
}