From de89983364e7782e7dfc456c138d9870a60dfec3 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 Aug 2018 01:03:01 +0200 Subject: [PATCH] slow loop LCD on LND scanning --- home.admin/00infoLCD.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index 37f4c26..7f2d073 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -26,6 +26,7 @@ if [ "$USER" = "pi" ]; then fi # show updating status in loop + chain="" while : do @@ -54,11 +55,14 @@ if [ "$USER" = "pi" ]; then elif [ ${setupStep} -lt 100 ]; then # setup process init is done and not finished + if [ ${#chain} -eq 0 ];then + # get chain if not available before + chain=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 2>/dev/null | jq -r '.chain') + fi lndSyncing=$(sudo -u bitcoin /usr/local/bin/lncli getinfo 2>/dev/null | jq -r '.synced_to_chain' | grep -c false) - chain=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 2>/dev/null | jq -r '.chain') locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null | grep -c unlock) - if [ ${locked} -gt 0 ]; then + if [ ${locked} -gt 0 ]; then # special case: LND wallet is locked ---> show unlock info l1="!!! LND WALLET IS LOCKED !!!\n" @@ -72,7 +76,7 @@ if [ "$USER" = "pi" ]; then # special case: LND is syncing /home/admin/80scanLND.sh - sleep 5 + sleep 20 else