mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-23 23:31:02 +02:00
htlcswitch: bounce downstream adds when flushing
This commit is contained in:
parent
5ab69aedc7
commit
a9d5235c62
@ -1457,6 +1457,17 @@ func (l *channelLink) handleDownstreamUpdateAdd(pkt *htlcPacket) error {
|
|||||||
return errors.New("not an UpdateAddHTLC packet")
|
return errors.New("not an UpdateAddHTLC packet")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are flushing the link in the outgoing direction we can't add
|
||||||
|
// new htlcs to the link and we need to bounce it
|
||||||
|
if l.IsFlushing(Outgoing) {
|
||||||
|
l.mailBox.FailAdd(pkt)
|
||||||
|
|
||||||
|
return NewDetailedLinkError(
|
||||||
|
&lnwire.FailPermanentChannelFailure{},
|
||||||
|
OutgoingFailureLinkNotEligible,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// If hodl.AddOutgoing mode is active, we exit early to simulate
|
// If hodl.AddOutgoing mode is active, we exit early to simulate
|
||||||
// arbitrary delays between the switch adding an ADD to the
|
// arbitrary delays between the switch adding an ADD to the
|
||||||
// mailbox, and the HTLC being added to the commitment state.
|
// mailbox, and the HTLC being added to the commitment state.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user