From 6d30ab6c4fc4f921db62f69df37d810498a47f67 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 12 Dec 2023 13:16:58 -0800 Subject: [PATCH] htlcswitch: drop connection if link updates after stfu --- htlcswitch/link.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htlcswitch/link.go b/htlcswitch/link.go index b56b0897f..cf9ba8ba9 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -1979,6 +1979,13 @@ func (l *channelLink) cleanupSpuriousResponse(pkt *htlcPacket) { // updates from the upstream peer. The upstream peer is the peer whom we have a // direct channel with, updating our respective commitment chains. func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) { + // First check if the message is an update and we are capable of + // receiving updates right now. + if msg.MsgType().IsChannelUpdate() && !l.quiescer.CanRecvUpdates() { + l.stfuFailf("update received after stfu: %T", msg) + return + } + switch msg := msg.(type) { case *lnwire.UpdateAddHTLC: if l.IsFlushing(Incoming) {