Skip to content

Instantly share code, notes, and snippets.

@thephez
Created September 20, 2017 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thephez/3de6f2c787a73d5b675b1e1e93fac46b to your computer and use it in GitHub Desktop.
Save thephez/3de6f2c787a73d5b675b1e1e93fac46b to your computer and use it in GitHub Desktop.
Get a list of my empty Dash addresses
#!/bin/bash
# Get list of addresses and store in array (may include send addresses not belonging to this wallet)
mapfile -t ADDRESS_LIST < <(dash-cli -rpcuser=username -rpcpassword=password listreceivedbyaddress 0 true | jq -r '.[].address')
# Check each address to see if it is mine and output only those that are
for addr in "${ADDRESS_LIST[@]}"
do
MINE=$(dash-cli -rpcuser=username -rpcpassword=password validateaddress "$addr" | jq .ismine)
if [ "$MINE" == "true" ]; then
echo "$addr"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment