update: don't update cores unnecessarily

This commit is contained in:
nahuhh 2024-12-27 00:21:09 +00:00
parent d665889123
commit c31fb46387

View file

@ -34,18 +34,21 @@ for coin in "${chain[@]}"; do
if [[ -d $BINDIR/$coin ]]; then if [[ -d $BINDIR/$coin ]]; then
UPDATE=$($BINDIR/$coin/"$coind"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions) UPDATE=$($BINDIR/$coin/"$coind"d --version | head -n 1 | grep -Fxf $SWAP_DATADIR/basicswap/core_versions)
fi if [[ -z $UPDATE ]]; then
select+="$coin,"
if [[ -z $UPDATE ]]; then list="${select%,}"
select+="$coin," fi
list="${select%,}"
fi fi
done done
if [[ -n $select ]]; then if [[ -n $list ]]; then
withoutCoins=""
if [[ ! $list =~ "particl" ]]; then
withoutCoins="--withoutcoins=particl"
fi
echo "Updating $list" echo "Updating $list"
. $SWAP_DATADIR/venv/bin/activate . $SWAP_DATADIR/venv/bin/activate
basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins=$list basicswap-prepare --datadir=$SWAP_DATADIR --preparebinonly --withcoins=$list "${withoutCoins}"
else else
echo "Coin Cores are up to date" echo "Coin Cores are up to date"
fi fi