diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 42009a4e..d85d0c6e 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -1414,6 +1414,13 @@ func (l *channelLink) processLockedInHtlcs( fwdInfo := chanIterator.ForwardingInstructions() switch fwdInfo.NextHop { case exitHop: + if l.cfg.DebugHTLC && l.cfg.HodlHTLC { + log.Warnf("hodl HTLC mode enabled, " + + "will not attempt to settle " + + "HTLC with sender") + continue + } + // First, we'll check the expiry of the HTLC // itself against, the current block height. If // the timeout is too soon, then we'll reject @@ -1530,13 +1537,6 @@ func (l *channelLink) processLockedInHtlcs( } } - if l.cfg.DebugHTLC && l.cfg.HodlHTLC { - log.Warnf("hodl HTLC mode enabled, " + - "will not attempt to settle " + - "HTLC with sender") - continue - } - preimage := invoice.Terms.PaymentPreimage err = l.channel.SettleHTLC(preimage, pd.HtlcIndex) if err != nil {