Created
September 20, 2017 15:28
-
-
Save thephez/3de6f2c787a73d5b675b1e1e93fac46b to your computer and use it in GitHub Desktop.
Get a list of my empty Dash addresses
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
#!/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