Skip to content

Instantly share code, notes, and snippets.

@kamk
Created August 19, 2021 08:19
Show Gist options
  • Save kamk/296cef667fa98f63829a03ad03b87b48 to your computer and use it in GitHub Desktop.
Save kamk/296cef667fa98f63829a03ad03b87b48 to your computer and use it in GitHub Desktop.
Search for missing transaction
#!/bin/bash
# customize this
cliprog="./bin/bitcoin-cli -conf=./datadir/bitcoin.conf"
n=0
while [[ $n -le $((16#FFFFFFFF)) ]]; do
txid=$(printf "1f728eebeab7bb2bc715e2f1323f9d925bcd2bcffa234d31cffff70d%08x\n" $n)
echo $n
$cliprog getrawtransaction $txid 2> /dev/null
if [[ $? -eq 0 ]]; then
echo "FOUND: $txid"
fi
n=$(($n+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment