htlcswitch: drop connection if link updates after stfu
This commit is contained in:
1 file changed
+7
@@ -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
|
// updates from the upstream peer. The upstream peer is the peer whom we have a
|
||||||
// direct channel with, updating our respective commitment chains.
|
// direct channel with, updating our respective commitment chains.
|
||||||
func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
|
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) {
|
switch msg := msg.(type) {
|
||||||
case *lnwire.UpdateAddHTLC:
|
case *lnwire.UpdateAddHTLC:
|
||||||
if l.IsFlushing(Incoming) {
|
if l.IsFlushing(Incoming) {
|
||||||
|
|||||||
Reference in new issue
Block a user