From 7f8b90fea46f2a33ed8a0f56e5f58b0daf98db38 Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Sat, 30 Nov 2024 12:38:34 +0000 Subject: [PATCH] coins: add bitcoincash --- bsx/addcoin.sh | 2 +- bsx/auto_coinupd8.sh | 27 ++++++++++++++++----------- bsx/removecoin.sh | 2 +- core_versions | 1 + 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/bsx/addcoin.sh b/bsx/addcoin.sh index 4e89a62..8184594 100755 --- a/bsx/addcoin.sh +++ b/bsx/addcoin.sh @@ -1,7 +1,7 @@ #!/bin/bash ## Prompt for user input -printf "\n\nThe following coins can be added (case sensitive)\nbitcoin\ndash\ndecred\nfiro\nlitecoin\npivx\nwownero\n\n" +printf "\n\nThe following coins can be added (case sensitive)\nbitcoin\nbitcoincash\ndash\ndecred\nfiro\nlitecoin\npivx\nwownero\n\n" read -p 'Full name of coin to add [example: litecoin] ' addcoin ## Confirm read -p $'\nAdd '$addcoin' to your BasicSwap install, correct? Press ENTER to continue. CTRL-C to exit' diff --git a/bsx/auto_coinupd8.sh b/bsx/auto_coinupd8.sh index bbd63dd..ec04fd3 100755 --- a/bsx/auto_coinupd8.sh +++ b/bsx/auto_coinupd8.sh @@ -10,6 +10,7 @@ echo "Checking for Coin updates" && sleep 1 chain=( bitcoin +bitcoincash dash decred firo @@ -23,22 +24,26 @@ wownero list="" select="" for coin in "${chain[@]}"; do + if [[ $coin == bitcoincash ]]; then + coind="bitcoin" + elif [[ $coin == decred ]]; then + coind="dcr" + else + coind="$coin" + fi + if [[ -d $BINDIR/$coin ]]; then - if [[ $coin == decred ]]; then - UPDATE=$($BINDIR/$coin/dcrd --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) - else - UPDATE=$($BINDIR/$coin/"$coin"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) - fi - if [[ -z $UPDATE ]]; then - select+="$coin," - list=${select%,} - fi + UPDATE=$($BINDIR/$coin/"$coind"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) + fi + + if [[ -z $UPDATE ]]; then + select+="$coin," + list="${select%,}" fi done -echo "Updating $list" - if [[ -n $select ]]; then + echo "Updating $list" . $SWAP_DATADIR/venv/bin/activate basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins=$list else diff --git a/bsx/removecoin.sh b/bsx/removecoin.sh index ed33e50..1d3537e 100755 --- a/bsx/removecoin.sh +++ b/bsx/removecoin.sh @@ -1,7 +1,7 @@ #!/bin/bash ## Prompt for user input -printf "\n\nThe following coins can be disabled (case sensitive)\nbitcoin\ndash\ndecred\nfiro\nlitecoin\nmonero\npivx\nwownero\n\n" +printf "\n\nThe following coins can be disabled (case sensitive)\nbitcoin\nbitcoincash\ndash\ndecred\nfiro\nlitecoin\nmonero\npivx\nwownero\n\n" read -p 'Full name of coin to disable [example: wownero] ' disablecoin ## Confirm printf "\nDisable $disablecoin on your BasicSwap install, correct? Press any key to continue. CTRL-C to exit\n" diff --git a/core_versions b/core_versions index 123bb43..64cb1eb 100644 --- a/core_versions +++ b/core_versions @@ -1,4 +1,5 @@ Bitcoin Core version v26.0.0 +Bitcoin Cash Node Daemon version v27.1.0-9f9aa5a6e dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64) Dash Core version v21.1.0 Firo Core Daemon version v0.14.14.0-ge0c423805