htlcswitch: with debughtlc+hodlhtlc mode, skip all HTLC level checks

This commit is contained in:
Olaoluwa Osuntokun 2018-01-16 20:19:46 -08:00
parent e34850c7af
commit 703057c821
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
1 changed files with 7 additions and 7 deletions

View File

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