From d2deb3b6d9e1c8faf07ce3d753ddc62913b23b21 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 Aug 2018 00:46:30 +0200 Subject: [PATCH] Try to move chain sync into lnd scan --- home.admin/70initLND.sh | 56 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index e6f5114f..e4ddeac8 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -19,34 +19,34 @@ fi echo "OK - ${network}d is running" echo "" -###### Wait for Blochain Sync -echo "*** Syncing Blockchain ***" -ready=0 -while [ ${ready} -eq 0 ] - do - progress="$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.verificationprogress')" - verySmallProgress=$(echo $progress | grep -c 'e-'); - if [ ${verySmallProgress} -eq 1 ]; then - progress="0.00"; - fi - ready=$(echo $progress'>0.99' | bc -l) - sync_percentage=$(printf "%.2f%%" "$(echo $progress | awk '{print 100 * $1}')") - #echo "progress($progress) verySmallProgress($verySmallProgress) ready($ready) sync_percentage($sync_percentage)" - if [ ${#ready} -eq 0 ]; then - echo "waiting for init ... can take a while" - ready=0 - elif [ "$sync_percentage" = "0.00%" ]; then - echo "waiting for network ... can take a while" - ready=0 - elif [ ${ready} -eq 0 ]; then - echo "${sync_percentage}" - else - echo "finishing sync ... can take a while" - fi - sleep 3 - done -echo "OK - Blockchain is synced" -echo "" +###### Wait for Blochain Sync --> LET DO THIS LATER ON LND SCAN +#echo "*** Syncing Blockchain ***" +#ready=0 +#while [ ${ready} -eq 0 ] +# do +# progress="$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.verificationprogress')" +# verySmallProgress=$(echo $progress | grep -c 'e-'); +# if [ ${verySmallProgress} -eq 1 ]; then +# progress="0.00"; +# fi +# ready=$(echo $progress'>0.99' | bc -l) +# sync_percentage=$(printf "%.2f%%" "$(echo $progress | awk '{print 100 * $1}')") +# #echo "progress($progress) verySmallProgress($verySmallProgress) ready($ready) sync_percentage($sync_percentage)" +# if [ ${#ready} -eq 0 ]; then +# echo "waiting for init ... can take a while" +# ready=0 +# elif [ "$sync_percentage" = "0.00%" ]; then +# echo "waiting for network ... can take a while" +# ready=0 +# elif [ ${ready} -eq 0 ]; then +# echo "${sync_percentage}" +# else +# echo "finishing sync ... can take a while" +# fi +# sleep 3 +# done +#echo "OK - Blockchain is synced" +#echo "" ###### LND Config echo "*** LND Config ***"