added loop at invoice creation waiting for ldn to sync

This commit is contained in:
Raumi 2019-02-24 09:34:07 +01:00
parent 43fce1f609
commit 4dc2de5644

View File

@ -17,16 +17,19 @@ echo ""
echo "*** Precheck ***"
# check if chain is in sync
chainInSync=$(lncli --chain=${network} --network=${chain}net getinfo | grep '"synced_to_chain": true' -c)
if [ ${chainInSync} -eq 0 ]; then
echo "!!!!!!!!!!!!!!!!!!!"
echo "FAIL - 'lncli getinfo' shows 'synced_to_chain': false"
echo "Wait until chain is sync with LND and try again."
echo "!!!!!!!!!!!!!!!!!!!"
echo ""
exit 1
# TODO: Wait and loop. Offer the user a "abort wait" button
fi
cmdChainInSync="lncli --chain=${network} --network=${chain}net getinfo | grep '"synced_to_chain": true' -c"
chainInSync=$(cmdChainInSync)
while [ ${chainInSync} -eq 0 ]; do
dialog --title "Fail: not in sync" \
--ok-label "Try now" \
--cancel-label "Give up" \
--pause "\n\n'lncli getinfo' shows 'synced_to_chain': false\n\nTry again in a few seconds." 15 60 5
if [ $? -gt 0 ]; then
exit 1
fi
chainInSync=$(cmdChainInSync)
done
# check number of connected peers
echo "check for open channels"