1
0

fix watchtower regtest flakiness caused by CTN variability. fixes #7961

This commit is contained in:
ThomasV
2022-09-01 09:56:46 +02:00
parent 6d77253ac2
commit 70da10d662
2 changed files with 8 additions and 5 deletions

View File

@@ -353,14 +353,15 @@ if [[ $1 == "watchtower" ]]; then
echo "alice pays bob again"
invoice2=$($bob add_request 0.01 -m "invoice2" | jq -r ".lightning_invoice")
$alice lnpay $invoice2
alice_ctn=$($alice list_channels | jq '.[0].local_ctn')
msg="waiting until watchtower is synchronized"
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [[ $watchtower_ctn != "3" ]]; do
sleep 1
msg="$msg."
printf "$msg\r"
# watchtower needs to be at latest revoked ctn
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [[ $watchtower_ctn != $((alice_ctn-1)) ]]; do
sleep 0.1
printf "$msg $alice_ctn $watchtower_ctn\r"
done
printf "\n"
echo "alice and bob do nothing"
echo "stopping alice and bob"
$bob stop
$alice stop
ctx_id=$($bitcoin_cli sendrawtransaction $ctx)