Browse Source

fix sync flag

v1.3
Christian Rotzoll 6 years ago
parent
commit
206a07a990
  1. 3
      home.admin/00raspiblitz.sh
  2. 4
      home.admin/50syncHDD.sh

3
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"

4
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"

Loading…
Cancel
Save