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.
(build on #93)
does not require an additional re-index after #93
This PR takes advantage of the
tx_position
component of the address history index to ensure that transactions returned by the.../txs/summary
endpoints are also correctly ordered.This fixes some issues with the address balance charts on mempool.space, where the total balance could spike higher than it should when the same coins are recycled through multiple transactions in the same block.
E.g, for the address bc1pn8ynw7a0fec5daqfv7h4r2hvta82dpsztcu30s4fgh2958yd7pkqnrkkjy
Before: many erroneous balance spikes, for example when the same ~4k sats is received and spent twice in the same block across four transactions, we incorrectly show the balance spiking to 8k sats because the events are out of order:
After: the balance chart is correct: