close issue #29

This commit is contained in:
rootzoll 2018-08-02 18:45:09 +02:00
parent 00b07362f2
commit 67a926c876

View file

@ -17,10 +17,18 @@ total=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblo
# calculate progress in percent
percent=$(awk "BEGIN { pc=100*${item}/${total}; i=int(pc); print (pc-i<0.5)?i:i+1 }")
if [ ${percent} -e 100 ]; then
if [ ${percent} -eq 100 ]; then
# normally if 100% gets calculated, item parsed the wrong height
percent=0
fi
infoStr=$(echo " Lightning Rescanning Blockchain ${percent}%\nplease wait - this can take some time")
# check if blockchain is still syncing
isWaitingBlockchain=$( sudo -u bitcoin tail -n 2 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep "Waiting for chain backend to finish sync" -c )
if [ ${isWaitingBlockchain} -gt 0 ]; then
infoStr=" Waiting for final Blockchain Sync\nplease wait - this can take some time"
fi
# display progress to user
dialog --backtitle "RaspiBlitz (${localip} / ${network} / ${chain})" --infobox " Lightning Rescanning Blockchain ${percent}%\nplease wait - this can take some time" 4 42
dialog --backtitle "RaspiBlitz (${localip} / ${network} / ${chain})" --infobox "${infoStr}" 4 42