This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# starting from `listtransactions` the script collects the inputs and | |
# the output amounts to calculate the fees. | |
# the inputs are collected with a SQL statement inside outputs table. | |
lightning-cli listtransactions| jq -c '.transactions[]' | while read object | |
do export hash=$(jq '.hash'<<<$object) | |
export inputs=$(jq '.inputs'<<<$object) | |
export outputs=$(jq '[.outputs[]]'<<<$object) | |
export satoshis=$(jq '[.[].satoshis[0:-4] |tonumber / 1000]| add' <<< $outputs) | |
export block=$(jq '.blockheight' <<< $object) |
OlderNewer