From 67a926c876d3150180bfe981787d6bf1637d40fc Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 2 Aug 2018 18:45:09 +0200 Subject: [PATCH] close issue #29 --- home.admin/80scanLND.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 2d54963..f7a3313 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -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 \ No newline at end of file +dialog --backtitle "RaspiBlitz (${localip} / ${network} / ${chain})" --infobox "${infoStr}" 4 42 \ No newline at end of file