simln-lib: enforce HTLC policy limits against the correct party - #315
Open
elnosh wants to merge 1 commit into
Open
simln-lib: enforce HTLC policy limits against the correct party#315elnosh wants to merge 1 commit into
elnosh wants to merge 1 commit into
Conversation
carlaKC
reviewed
Aug 14, 2026
carlaKC
left a comment
Contributor
There was a problem hiding this comment.
Makes sense. Could you update the readme's Advanced Usage section to make note of how these will be used?
`check_outgoing_addition` previously checked every limit against the sending node's own policy. Split each limit to the party that owns it: * htlc_minimum_msat / htlc_maximum_msat are forwarder-advertised fields of the sender's own gossiped channel_update (populated into the graph from `self.policy`), so they are enforced against `self.policy`. * max_accepted_htlcs / max_htlc_value_in_flight_msat are receiver- negotiated (BOLT-2 channel open, never gossiped), so they are enforced against the counterparty's policy. Keeping this at add time means the final recipient's inbound limits are enforced too, since it never adds an outgoing HTLC. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check_outgoing_additionpreviously checked every limit against the sending node's own policy. Split each limit to the party that owns it:self.policy), so they are enforced againstself.policy.