mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 01:33:02 +01:00
routing: skip amtInRange for custom HTLCs
We might be trying to send an invoice amount that's greater than the size of the channel, but once you factor in the custom channel logic, an actual HTLC can be sent over the channel to pay that larger payment. As a result, we'll skip over this check if a have a custom HTLC.
This commit is contained in:
parent
f927563049
commit
ec2b2c6e1e
@ -247,8 +247,13 @@ func (u *edgeUnifier) getEdgeLocal(netAmtReceived lnwire.MilliSatoshi,
|
||||
// local channel.
|
||||
amt := netAmtReceived + lnwire.MilliSatoshi(inboundFee)
|
||||
|
||||
// Check valid amount range for the channel.
|
||||
if !edge.amtInRange(amt) {
|
||||
// Check valid amount range for the channel. We skip this test
|
||||
// for payments with custom HTLC data, as the amount sent on
|
||||
// the BTC layer may differ from the amount that is actually
|
||||
// forwarded in custom channels.
|
||||
if bandwidthHints.firstHopCustomBlob().IsNone() &&
|
||||
!edge.amtInRange(amt) {
|
||||
|
||||
log.Debugf("Amount %v not in range for edge %v",
|
||||
netAmtReceived, edge.policy.ChannelID)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user