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:
(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: