Skip to content

lnchannel: split determine_htlc_constraints from _assert_can_add_htlc #9781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

accumulator
Copy link
Member

@accumulator accumulator commented May 2, 2025

(partial) fix for #9700

@accumulator accumulator changed the title lnchannel: split determine_valid_htlc_amount_range from _assert_can_add_htlc lnchannel: split determine_htlc_constraints from _assert_can_add_htlc May 2, 2025
@ecdsa
Copy link
Member

ecdsa commented May 7, 2025

can you provide a description? how is this related to #9700?

@accumulator
Copy link
Member Author

can you provide a description? how is this related to #9700?

This split is to allow lnworker.num_sats_can_{receive,send} to use lnchannel.determine_htlc_constraints to calculate the available balance for a single payment.

The idea is to extend lnworker.num_sats_can_{receive,send} with extra kwargs so it can determine limits on a single payment, e.g. by adding the kwargs single_payment:bool and mpp:bool

@accumulator accumulator force-pushed the fix_9700 branch 5 times, most recently from 7b54d00 to 9771fed Compare May 8, 2025 14:33
… query channel constraints

for single payment amount limits
@accumulator accumulator marked this pull request as ready for review May 8, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants