|
|
@ -3,15 +3,19 @@ _temp="./download/dialog.$$" |
|
|
|
_error="./.error.out" |
|
|
|
sudo chmod 7777 ${_error} |
|
|
|
|
|
|
|
# load network and chain info |
|
|
|
network=`cat .network` |
|
|
|
chain=$(sudo -bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain') |
|
|
|
# load raspiblitz config data (with backup from old config) |
|
|
|
source /mnt/hdd/raspiblitz.conf 2>/dev/null |
|
|
|
if [ ${#network} -eq 0 ]; then network=`cat .network`; fi |
|
|
|
if [ ${#chain} -eq 0 ]; then |
|
|
|
echo "gathering chain info ... please wait" |
|
|
|
chain=$(${network}-cli getblockchaininfo | jq -r '.chain') |
|
|
|
fi |
|
|
|
|
|
|
|
echo "" |
|
|
|
echo "*** Precheck ***" |
|
|
|
|
|
|
|
# check if chain is in sync |
|
|
|
chainInSync=$(lncli --chain=${network} getinfo | grep '"synced_to_chain": true' -c) |
|
|
|
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" |
|
|
@ -23,7 +27,7 @@ fi |
|
|
|
|
|
|
|
# check number of connected peers |
|
|
|
echo "check for open channels" |
|
|
|
openChannels=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} listchannels 2>/dev/null | grep chan_id -c) |
|
|
|
openChannels=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net listchannels 2>/dev/null | grep chan_id -c) |
|
|
|
if [ ${openChannels} -eq 0 ]; then |
|
|
|
echo "" |
|
|
|
echo "!!!!!!!!!!!!!!!!!!!" |
|
|
@ -46,7 +50,7 @@ if [ ${#amount} -eq 0 ]; then |
|
|
|
fi |
|
|
|
|
|
|
|
# build command |
|
|
|
command="lncli --chain=${network} addinvoice ${amount}" |
|
|
|
command="lncli --chain=${network} --network=${chain}net addinvoice ${amount}" |
|
|
|
|
|
|
|
# info output |
|
|
|
clear |
|
|
@ -84,7 +88,7 @@ else |
|
|
|
echo "" |
|
|
|
echo ${payReq} |
|
|
|
echo "" |
|
|
|
echo "You can use 'lncli --chain=${network} lookupinvoice ${rhash}' to check the payment. " |
|
|
|
echo "You can use 'lncli --chain=${network} --network=${chain}net lookupinvoice ${rhash}' to check the payment. " |
|
|
|
|
|
|
|
# TODO: Offer to go into monitor for incommin payment loop. |
|
|
|
|
|
|
|