Browse Source

Update cleanwallettransactions to work with any coin argument

master
Luke Childs 5 years ago
parent
commit
3f22cbf776
  1. 24
      cleanwallettransactions.sh

24
cleanwallettransactions.sh

@ -4,11 +4,35 @@ cd "${BASH_SOURCE%/*}" || exit
# Coin we're resetting
coin=$1
possible_coins="
KMD
HUSH3
$(./listassetchains)
"
function list_include_item {
local list="$1"
local item="$2"
if [[ $list =~ (^|[[:space:]])"$item"($|[[:space:]]) ]] ; then
result=0
else
result=1
fi
return $result
}
if [[ -z "${coin}" ]]; then
echo "No coin set, can't clean wallet transactions!"
exit
fi
list_include_item "$possible_coins" "$coin"
result=$?
if [[ $result = 1 ]]; then
echo "[$coin] $(date) | No clean wallet transaction RPC method available for this coin"
exit
fi
cli=$(./listclis.sh ${coin})
result=$($cli cleanwallettransactions)

Loading…
Cancel
Save