From 703057c821942d0ac7a45cdb0f9510707e8109a1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 16 Jan 2018 20:19:46 -0800 Subject: [PATCH] htlcswitch: with debughtlc+hodlhtlc mode, skip all HTLC level checks --- htlcswitch/link.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 {