mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-25 19:21:57 +02:00
check synced to chain for cln
This commit is contained in:
@@ -272,11 +272,17 @@ fi
|
|||||||
clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running)
|
clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running)
|
||||||
echo "clnActive=${clnRunning}"
|
echo "clnActive=${clnRunning}"
|
||||||
if [ ${clnRunning} -eq 1 ]; then
|
if [ ${clnRunning} -eq 1 ]; then
|
||||||
|
|
||||||
clnInfo=$(sudo -u bitcoin lightning-cli getinfo)
|
clnInfo=$(sudo -u bitcoin lightning-cli getinfo)
|
||||||
clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]')
|
clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]')
|
||||||
echo "clnBlockHeight=${clnBlockHeight}"
|
echo "clnBlockHeight=${clnBlockHeight}"
|
||||||
echo "# TODO: cln status statistics"
|
clnBlockHeightPlusOne= 'expr $clnBlockHeight + 1'
|
||||||
|
echo "clnBlockHeightPlusOne=${clnBlockHeightPlusOne}"
|
||||||
|
echo "total=${total}"
|
||||||
|
if [ "${total}" == "${clnBlockHeight}" ] || [ "${total}" == "${clnBlockHeightPlusOne}" ]; then
|
||||||
|
echo "syncedToChain=1"
|
||||||
|
else
|
||||||
|
echo "syncedToChain=0"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# touchscreen statistics
|
# touchscreen statistics
|
||||||
|
Reference in New Issue
Block a user