This PR is on top of #21422
Context: #17314 (comment)
What?
Add fee rate distribution information in -getinfo
Why?
-getinfo
has almost everything except a section for mempool and some information which can be helpful while doing transactions or analysis.- All PRs trying to add related things in GUI are dead: https://github.com/bitcoin-core/gui/pull/320#issuecomment-912821023. We can try adding basic things in
-getinfo
and see if it helps users. It can be be optional and only work if some argument is used. - Fee rate distribution in mempool helps more than any fee estimation because there is nothing to predict. You just need to look at fee rates used by others and bid for block space accordingly.
How?
Approach similar to progress bar which was added in #22547
- Use results from
bitcoin-cli getmempoolinfo "[1,10,100,200,1000]"
- Use dynamic increment for bar in GetFeerateBar() so that it works for different mempool size and all chains.
- Magenta color for mempool section
Testing
- Run
bitcoind
(testnet, signet and mainnet) - Run command:
watch -c -t -n 1 bitcoin-cli -getinfo -color=always
- Check if everything look okay. Press Ctrl+C. Check different edge cases.