Skip to content

Instantly share code, notes, and snippets.

@harding
Created July 15, 2017 12:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harding/9f7e40fe610c0baa5d470bd5a5edd206 to your computer and use it in GitHub Desktop.
Save harding/9f7e40fe610c0baa5d470bd5a5edd206 to your computer and use it in GitHub Desktop.
Get in-block fees
sudo apt-get install jq num-utils
height=$( bitcoin-cli getblockchaininfo | jq .blocks ) ; for i in $( seq $((height-1008)) $height ) ; do echo -n "$i " ; bitcoin-cli getrawtransaction $( bitcoin-cli getblock $( bitcoin-cli getblockhash $i ) | jq -r '.tx[0]' ) true | jq '.vout[].value' | sed '$a-12.5' | numsum ; done > block-fees.dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment