Skip to content

Commit

Permalink
Some more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kristapsk committed Apr 12, 2024
1 parent be3d1f1 commit c025056
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cln-prune-protector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fi
. "$(dirname "$(readlink -m "$0")")/inc.common.sh"

log_with_date "Starting"
log_with_date "check_numblocks = $check_numblocks, check_interval = $check_interval"

if ! bitcoin-cli echo > /dev/null 2>&1; then
log_with_date "Bitcoin Core not running, exiting."
Expand Down Expand Up @@ -65,7 +66,7 @@ while :; do
log_with_date "Bitcoin Core not running."
elif wbh_res="$(lightning-cli waitblockheight 0 2> /dev/null)"; then
cln_bh="$(jq -r ".blockheight" <<< "$wbh_res")"
log_with_date "bitcoind blockheight $btc_bh, cln blockheigt $cln_bh"
log_with_date "bitcoind blockheight $btc_bh, cln blockheigt $cln_bh (diff = $(( btc_bh - cln_bh )))"
if (( $(( btc_bh - cln_bh )) > check_numblocks )); then
bitcoind_setnetworkactive false \
"$btc_bh - $cln_bh > $check_numblocks"
Expand Down

0 comments on commit c025056

Please sign in to comment.