-
Notifications
You must be signed in to change notification settings - Fork 353
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
Fix matching of second-stage HTLC claim in get_htlc_balance #2610
Merged
TheBlueMatt
merged 9 commits into
lightningdevkit:main
from
wpaulino:missing-htlc-claim-balance
Sep 29, 2023
Merged
Fix matching of second-stage HTLC claim in get_htlc_balance #2610
TheBlueMatt
merged 9 commits into
lightningdevkit:main
from
wpaulino:missing-htlc-claim-balance
Sep 29, 2023
Commits on Sep 29, 2023
-
Fix matching of second-stage HTLC claim in get_htlc_balance
We incorrectly assumed that the descriptor's output index from second-stage HTLC transaction would always match the HTLC's output index in the commitment transaction. This doesn't make any sense though, we need to make sure we map the descriptor to it's corresponding HTLC in the commitment. Instead, we check that the transaction from which the descriptor originated from spends the HTLC in question. Note that pre-anchors, second-stage HTLC transactions are always 1 input-1 output, so previously we would only match if the HTLC was the first output in the commitment transaction. Post-anchors, they are malleable, so we can aggregate multiple HTLC claims into a single transaction making this even more likely to happen. Unfortunately, we lacked proper coverage in this area so the bug went unnoticed. To address this, we aim to extend our existing coverage of `get_claimable_balances` to anchor outputs channels in the following commits.
Configuration menu - View commit details
-
Copy full SHA for 0930be3 - Browse repository at this point
Copy the full SHA 0930be3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52d76f9 - Browse repository at this point
Copy the full SHA 52d76f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 28f2dac - Browse repository at this point
Copy the full SHA 28f2dacView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea4b187 - Browse repository at this point
Copy the full SHA ea4b187View commit details -
Configuration menu - View commit details
-
Copy full SHA for 898a200 - Browse repository at this point
Copy the full SHA 898a200View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4156d7c - Browse repository at this point
Copy the full SHA 4156d7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for fe45af6 - Browse repository at this point
Copy the full SHA fe45af6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a393ee - Browse repository at this point
Copy the full SHA 4a393eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd66a29 - Browse repository at this point
Copy the full SHA fd66a29View commit details
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.