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: Fix Stats and Utxo cache #44

Merged
merged 1 commit into from
Sep 23, 2023
Merged

Conversation

junderw
Copy link
Member

@junderw junderw commented Sep 17, 2023

Fixes #11

At the very least it fixes the more embarrassing ones.

  1. Negative balance
  2. Non-zero balance even though number of funds and spends txos are equal etc.

Also, comparing the confirmed_height in the history key to the blockid height (from the local best header chain) is a more efficient way to weed out the re-confirmed-in-separate-block issue.
If a re-org happens and the same TX is in the same height block, then it will perfectly match the existing key (and won't duplicate)

@junderw junderw force-pushed the junderw/fix-broken-stats branch from f4caa18 to 1e09819 Compare September 17, 2023 21:02
@junderw junderw changed the title Fix: Broken stats treated like current re-org Fix: Fix Stats and Utxo cache Sep 18, 2023
Copy link
Contributor

@mononaut mononaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK @ a824fd8e

I haven't been able to find any bad stats locally, or reproduce the issue in regtest, so I couldn't test the actual fix.

but the code looks good, and it doesn't seem to break anything.

@junderw junderw force-pushed the junderw/fix-broken-stats branch from a824fd8 to 3615c48 Compare September 19, 2023 02:11
Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@softsimon softsimon merged commit c12eef6 into mempool Sep 23, 2023
@softsimon softsimon deleted the junderw/fix-broken-stats branch September 23, 2023 15:24
SatoKentaNayoro pushed a commit to boolnetwork/mempool-electrs that referenced this pull request Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stale block address indexing bug
3 participants