Blockstream / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
318 stars 130 forks source link

Fix address stats with re-orged history entries #61

Closed shesek closed 8 months ago

shesek commented 1 year ago

There might be history entries where the txid ended up confirming at a different block height following a re-org. Before this fix, these entries would get counted twice, once with the initial re-orged confirmation height, then again with the final confirmation height.

See https://github.com/mempool/electrs/pull/12.

shesek commented 8 months ago

If there are no objections, I will go ahead and merge this PR.

Note that there might still be cached script stats entries with incorrect values in db. Fixing this would require deleting the cache database at db/<network>/newindex/cache (and only it, not the txstore/history databases), which would also necessitate re-running the popular-scripts pre-cache.

LeoComandini commented 8 months ago

utACK 74e93dfcc30b3e7ff47ea2cee6183c2de4753064, code review