diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 6a7c3128..df6bafc9 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -516,7 +516,14 @@ func (l *channelLink) Stop() { l.cfg.ChainEvents.Cancel() } - l.updateFeeTimer.Stop() + // Ensure the channel for the timer is drained. + if !l.updateFeeTimer.Stop() { + select { + case <-l.updateFeeTimer.C: + default: + } + } + l.hodlQueue.Stop() close(l.quit) diff --git a/lnwire/error.go b/lnwire/error.go index c9fa39a8..a6588b3e 100644 --- a/lnwire/error.go +++ b/lnwire/error.go @@ -124,7 +124,7 @@ func (c *Error) MsgType() MessageType { // This is part of the lnwire.Message interface. func (c *Error) MaxPayloadLength(uint32) uint32 { // 32 + 2 + 65501 - return 65535 + return MaxMessagePayload } // isASCII is a helper method that checks whether all bytes in `data` would be