Last active
October 6, 2022 08:13
-
-
Save mutatrum/f43517d919ed749fbc78244cb5514f28 to your computer and use it in GitHub Desktop.
Find transactions which put value on nulldata
This file contains hidden or 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
#!/bin/bash | |
BLOCK=$(bitcoin-cli getblockcount) | |
for ((i=BLOCK; i>=1; i--)) | |
do | |
echo $i | |
bitcoin-cli getblock $(bitcoin-cli getblockhash $i) 3 | jq -L $HOME -r 'include ".jq/decode_hex"; | |
.tx[] | select(any(.vout[]; .scriptPubKey.type == "nulldata" and .value != 0)) | .txid + " " + (.vout[0].value * 1e8 | tostring) + " " + (.vout[0].scriptPubKey.hex[4:] | decode_hex)' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs to have decode_hex defined, see https://gist.github.com/mutatrum/71993083af307c8044faaec74d8e4fae