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

Limit how far we look into the blockchain #2731

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Commits on Sep 21, 2023

  1. Limit how far we look into the blockchain

    If we're unable to find the spending tx in the mempool, we start looking
    for it in the blockchain. Unfortunately, there are cases where we end up
    in that code path even though the spending tx is not confirmed:
    
    - a timeout on the `getTransaction` call
    - the spending tx gets dropped from our mempool for some reason
    - bitcoind is malicious or buggy
    
    Fetching the whole blockchain isn't really useful: after enough time has
    passed, we can be pretty sure that a potential attacker would have claimed
    the transaction's outputs already and we can't punish them. We limit this
    to the last month of blockchain data, which should be much larger than
    our `to_delay`.
    t-bast committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    8f8952c View commit details
    Browse the repository at this point in the history
  2. Make rescan limit configurable

    And add a unit test.
    t-bast committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    3a75af7 View commit details
    Browse the repository at this point in the history