lnpeer/lnworker: check dont_settle_htlcs when forwarding#10364
Merged
SomberNight merged 4 commits intospesmilo:masterfrom Dec 30, 2025
Merged
lnpeer/lnworker: check dont_settle_htlcs when forwarding#10364SomberNight merged 4 commits intospesmilo:masterfrom
SomberNight merged 4 commits intospesmilo:masterfrom
Conversation
If a payment hash is in LNWallet.dont_settle_htlcs the preimage shouldn't be released even when just forwarding.
Don't remove a payment hash from LNWallet.dont_settle_htlcs and dont_expire_htlcs if we are failing it. We might see another htlc with the same payment hash and should still not settle or expire it.
The new test TestPeerForwarding::test_dont_settle_htlcs_receiver_and_forwarder covers the receiver as well as the forwarder. So this unittest becomes obsolete as it only tests the receiver.
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.
Adds a check to
LNPeer._check_final_mpp_set_state()to not release the preimage of a forwarded htlc if the payment hash is still inLNWallet.dont_settle_htlcs.Stops removing payment hashes from
LNWallet.dont_settle_htlcsandLNWallet.dont_expire_htlcsinPeer._fail_htlc_set()as it can happen that htlcs get failed and we receive another mpp set with the same payment hash which should still not be settled/expired.Adds the forwarding case to the lnpeer unittests and consolidates the unittest with the existing
TestPeerDirect.test_dont_settle_htlcs.