diff --git a/home.admin/00raspiblitz.sh b/home.admin/00raspiblitz.sh index 9215931..eb6bd61 100755 --- a/home.admin/00raspiblitz.sh +++ b/home.admin/00raspiblitz.sh @@ -171,7 +171,8 @@ waitUntilChainNetworkIsReady() blockchainsize=$(sudo du -shbc /mnt/hdd/${network} 2>/dev/null | head -n1 | awk '{print $1;}') if [ ${#blockchainsize} -gt 0 ]; then if [ ${blockchainsize} -lt ${minSize} ]; then - if [ "${state}" != "resync" ]; then + isSyncing=$(sudo ls -la /mnt/hdd/bitcoin/blocks/.selfsync | grep -c '.selfsync') + if [ ${isSyncing} -eq 0 ]; then echo "blockchainsize(${blockchainsize})" echo "Missing Blockchain Data (<${minSize}) ..." clienterror="missing blockchain" diff --git a/home.admin/50syncHDD.sh b/home.admin/50syncHDD.sh index ac1a21e..113b630 100755 --- a/home.admin/50syncHDD.sh +++ b/home.admin/50syncHDD.sh @@ -59,10 +59,12 @@ fi echo "*** Activating Blockain Sync ***" sudo mkdir /mnt/hdd/${network} 2>/dev/null +sudo mkdir /mnt/hdd/${network}/blocks 2>/dev/null +sudo mkdir /mnt/hdd/${network}/chainstate 2>/dev/null sudo /home/admin/XXcleanHDD.sh -blockchain -force # set so that 10raspiblitz.sh has a flag to see that resync is running -sudo sed -i "s/^state=.*/state=resync/g" /home/admin/raspiblitz.info +sudo touch /mnt/hdd/${network}/blocks/.selfsync echo "OK - sync is activated"