Skip to content
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
merged 9 commits into from
Sep 29, 2023

Commits on Sep 29, 2023

  1. 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.
    TheBlueMatt authored and wpaulino committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    0930be3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    52d76f9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    28f2dac View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ea4b187 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    898a200 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4156d7c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fe45af6 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4a393ee View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fd66a29 View commit details
    Browse the repository at this point in the history