Fixed cn_props ETL, lightning startup and more

This commit is contained in:
kexkey
2021-11-24 00:26:45 -05:00
parent 4251a0c153
commit 8f1798dffc
6 changed files with 29 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ createbatcher() {
# POST http://192.168.111.152:8080/createbatcher
#
# Will UPDATE the batcher is it already exists (as per label)
# Will UPDATE the batcher if it already exists (as per label)
#
# args:
# - batcherLabel, optional, id can be used to reference the batcher

View File

@@ -51,6 +51,8 @@ ln_waitanyinvoice() {
sql "UPDATE cyphernode_props SET value='${pay_index}' WHERE property='pay_index'"
fi
return ${returncode}
}
while :
@@ -58,5 +60,12 @@ do
pay_index=$(sql "SELECT value FROM cyphernode_props WHERE property='pay_index'")
trace "[waitanyinvoice] pay_index=${pay_index}"
ln_waitanyinvoice ${pay_index}
sleep 5
if [ "$?" -eq "0" ]; then
# lightning is ready, let's wait 1 sec to fetch next pay_index...
sleep 1
else
# lightning is not ready, let's wait a little more...
sleep 5
fi
done