Reject incoming HTLCs with a high cltv_expiry#3323
Merged
Conversation
We currently reject HTLCs with a `cltv_expiry` higher than 2 weeks in the future when sending them (in the `sendAdd` method). That's because they would lock up our funds for a long period of time if our peer decided to force-close. Also, a large `cltv_expiry` makes slow jamming easier. We now apply the same limits to incoming HTLCs for consistency (since they may differ by `cltv_expiry_delta`). Note that we don't do it in the `receiveAdd` function, which would trigger a force-close. We just accept those HTLCs and then fail them, since it is harmless to have them only temporarily in our commitment as long as we don't relay.
sstone
approved these changes
Jul 7, 2026
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.
We currently reject HTLCs with a
cltv_expiryhigher than 2 weeks in the future when sending them (in thesendAddmethod). That's because they would lock up our funds for a long period of time if our peer decided to force-close. Also, a largecltv_expirymakes slow jamming easier.We now apply the same limits to incoming HTLCs for consistency (since they may differ by
cltv_expiry_delta). Note that we don't do it in thereceiveAddfunction, which would trigger a force-close. We just accept those HTLCs and then fail them, since it is harmless to have them only temporarily in our commitment as long as we don't relay.