Skip to content

[feature]: Don't Check Outgoing Policy for Direct Channels. #8597

Open
@ziggie1984

Description

@ziggie1984

Policies are used when forwarding payments but should NOT be checked against for direct local channels in pathfinding.

Use Case Example:

I restrict the Min_HTLC for forwarding but I want to send my direct channel peers keysends when rewarding them for inbound liquidity. (see https://twitter.com/alexbosworth/status/1772277264270446647)

Relevant code part:

we check this function also in the LocalEdge case:

func (u *unifiedEdge) amtInRange(amt lnwire.MilliSatoshi) bool {
// If the capacity is available (non-light clients), skip channels that
// are too small.
if u.capacity > 0 &&
amt > lnwire.NewMSatFromSatoshis(u.capacity) {
log.Tracef("Not enough capacity: amt=%v, capacity=%v",
amt, u.capacity)
return false
}
// Skip channels for which this htlc is too large.
if u.policy.MessageFlags.HasMaxHtlc() &&
amt > u.policy.MaxHTLC {
log.Tracef("Exceeds policy's MaxHTLC: amt=%v, MaxHTLC=%v",
amt, u.policy.MaxHTLC)
return false
}
// Skip channels for which this htlc is too small.
if amt < u.policy.MinHTLC {
log.Tracef("below policy's MinHTLC: amt=%v, MinHTLC=%v",
amt, u.policy.MinHTLC)
return false
}
return true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2should be fixed if one has timeenhancementImprovements to existing features / behaviourpaymentsRelated to invoices/payments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions