Using undo data for a block (rev?????.dat) we can retrieve value information about prevouts and calculate the final transaction fee (rate). This approach is about 80x faster, drops the requirement for -txindex
, and works for all non-pruned blocks.
0# 2018-11-25T16:36:19Z Bitcoin Core version v0.17.99.0-edc715240-dirty (release build)
1seq 550100 550200 0.00s user 0.00s system 62% cpu 0.004 total
2xargs -n1 src/bitcoin-cli getblockstats 0.21s user 0.19s system 17% cpu 2.302 total
3
4
5# 2018-11-25T16:39:17Z Bitcoin Core version v0.17.0 (release build)
6seq 550100 550200 0.00s user 0.00s system 87% cpu 0.002 total
7xargs -n1 src/bitcoin-cli getblockstats 0.24s user 0.22s system 0% cpu 3:19.42 total