htlcswitch: drop connection if link updates after stfu

This commit is contained in:
Keagan McClelland 2023-12-12 13:16:58 -08:00
parent 44c87ef1d7
commit 6d30ab6c4f
No known key found for this signature in database
GPG Key ID: FA7E65C951F12439

View File

@ -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) {