1
0

Merge pull request #7505 from bitromortac/2109-activate-watchtower

watchtower: continuously check for added channels
This commit is contained in:
ghost43
2021-09-28 16:46:19 +02:00
committed by GitHub
4 changed files with 21 additions and 11 deletions

View File

@@ -342,10 +342,17 @@ if [[ $1 == "watchtower" ]]; then
invoice2=$($bob add_lightning_request 0.01 -m "invoice2" | jq -r ".invoice")
$alice lnpay $invoice2
msg="waiting until watchtower is synchronized"
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [ $watchtower_ctn != "3" ]; do
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [[ $watchtower_ctn != "3" ]]; do
sleep 1
msg="$msg."
printf "$msg\r"
msg="$msg."
printf "$msg\r"
done
printf "\n"
echo "alice and bob do nothing"
$bob stop
$alice stop
ctx_id=$($bitcoin_cli sendrawtransaction $ctx)
echo "alice breaches with old ctx:" $ctx_id
echo "watchtower publishes justice transaction"
wait_until_spent $ctx_id 1 # alice's to_local gets punished immediately
fi