Browse Source

added loop at invoice creation waiting for ldn to sync

dev
Raumi 6 years ago
parent
commit
4dc2de5644
  1. 23
      home.admin/BBcreateInvoice.sh

23
home.admin/BBcreateInvoice.sh

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

Loading…
Cancel
Save