diff --git a/htlcswitch/link.go b/htlcswitch/link.go index c92c431712..7f0b3eb8cc 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -3793,7 +3793,18 @@ func (l *channelLink) processExitHop(add lnwire.UpdateAddHTLC, // As we're the exit hop, we'll double check the hop-payload included in // the HTLC to ensure that it was crafted correctly by the sender and // is compatible with the HTLC we were extended. - if add.Amount < fwdInfo.AmountToForward { + // + // For a special case, if the fwdInfo doesn't have any blinded path + // information, and the incoming HTLC had special extra data, then + // we'll skip this amount check. The invoice acceptor will make sure we + // reject the HTLC if it's not containing the correct amount after + // examining the custom data. + hasBlindedPath := fwdInfo.NextBlinding.IsSome() + customHTLC := len(add.CustomRecords) > 0 && !hasBlindedPath + log.Tracef("Exit hop has_blinded_path=%v custom_htlc_bypass=%v", + hasBlindedPath, customHTLC) + + if !customHTLC && add.Amount < fwdInfo.AmountToForward { l.log.Errorf("onion payload of incoming htlc(%x) has "+ "incompatible value: expected <=%v, got %v", add.PaymentHash, add.Amount, fwdInfo.AmountToForward)