htlcswitch: restore the ability to properly handle debughtlc recv's
This commit fixes a regression introduce in the prior commit which added full verification of the per-hop payloads to the ChannelLink interface. When this was initially implemented, the added checks weren’t guarded on the existence of debughtlc’s. As a result, debughtlc’s would be rejected as they don’t match the expected invoice value. This commit fixes that issue by only checking the hop payload if debug HTLC mode isn’t on.
This commit is contained in:
parent
a824a2a855
commit
01d54c29af
@ -928,7 +928,9 @@ func (l *channelLink) processLockedInHtlcs(
|
|||||||
// extended. Additionally, we'll ensure that
|
// extended. Additionally, we'll ensure that
|
||||||
// our time-lock value has been computed
|
// our time-lock value has been computed
|
||||||
// correctly.
|
// correctly.
|
||||||
if fwdInfo.AmountToForward != invoice.Terms.Value {
|
if !l.cfg.DebugHTLC &&
|
||||||
|
fwdInfo.AmountToForward != invoice.Terms.Value {
|
||||||
|
|
||||||
log.Errorf("Onion payload of incoming "+
|
log.Errorf("Onion payload of incoming "+
|
||||||
"htlc(%x) has incorrect value: "+
|
"htlc(%x) has incorrect value: "+
|
||||||
"expected %v, got %v", pd.RHash,
|
"expected %v, got %v", pd.RHash,
|
||||||
@ -940,7 +942,9 @@ func (l *channelLink) processLockedInHtlcs(
|
|||||||
needUpdate = true
|
needUpdate = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if fwdInfo.OutgoingCTLV != l.cfg.FwrdingPolicy.TimeLockDelta {
|
if !l.cfg.DebugHTLC &&
|
||||||
|
fwdInfo.OutgoingCTLV != l.cfg.FwrdingPolicy.TimeLockDelta {
|
||||||
|
|
||||||
log.Errorf("Onion payload of incoming "+
|
log.Errorf("Onion payload of incoming "+
|
||||||
"htlc(%x) has incorrect time-lock: "+
|
"htlc(%x) has incorrect time-lock: "+
|
||||||
"expected %v, got %v",
|
"expected %v, got %v",
|
||||||
|
Loading…
Reference in New Issue
Block a user