fix watchtower regtest flakiness caused by CTN variability. fixes #7961
This commit is contained in:
@@ -1134,6 +1134,8 @@ class Commands:
|
|||||||
'remote_pubkey': bh2u(chan.node_id),
|
'remote_pubkey': bh2u(chan.node_id),
|
||||||
'local_balance': chan.balance(LOCAL)//1000,
|
'local_balance': chan.balance(LOCAL)//1000,
|
||||||
'remote_balance': chan.balance(REMOTE)//1000,
|
'remote_balance': chan.balance(REMOTE)//1000,
|
||||||
|
'local_ctn': chan.get_latest_ctn(LOCAL),
|
||||||
|
'remote_ctn': chan.get_latest_ctn(REMOTE),
|
||||||
'local_reserve': chan.config[REMOTE].reserve_sat, # their config has our reserve
|
'local_reserve': chan.config[REMOTE].reserve_sat, # their config has our reserve
|
||||||
'remote_reserve': chan.config[LOCAL].reserve_sat,
|
'remote_reserve': chan.config[LOCAL].reserve_sat,
|
||||||
'local_unsettled_sent': chan.balance_tied_up_in_htlcs_by_direction(LOCAL, direction=SENT) // 1000,
|
'local_unsettled_sent': chan.balance_tied_up_in_htlcs_by_direction(LOCAL, direction=SENT) // 1000,
|
||||||
|
|||||||
@@ -353,14 +353,15 @@ if [[ $1 == "watchtower" ]]; then
|
|||||||
echo "alice pays bob again"
|
echo "alice pays bob again"
|
||||||
invoice2=$($bob add_request 0.01 -m "invoice2" | jq -r ".lightning_invoice")
|
invoice2=$($bob add_request 0.01 -m "invoice2" | jq -r ".lightning_invoice")
|
||||||
$alice lnpay $invoice2
|
$alice lnpay $invoice2
|
||||||
|
alice_ctn=$($alice list_channels | jq '.[0].local_ctn')
|
||||||
msg="waiting until watchtower is synchronized"
|
msg="waiting until watchtower is synchronized"
|
||||||
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [[ $watchtower_ctn != "3" ]]; do
|
# watchtower needs to be at latest revoked ctn
|
||||||
sleep 1
|
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [[ $watchtower_ctn != $((alice_ctn-1)) ]]; do
|
||||||
msg="$msg."
|
sleep 0.1
|
||||||
printf "$msg\r"
|
printf "$msg $alice_ctn $watchtower_ctn\r"
|
||||||
done
|
done
|
||||||
printf "\n"
|
printf "\n"
|
||||||
echo "alice and bob do nothing"
|
echo "stopping alice and bob"
|
||||||
$bob stop
|
$bob stop
|
||||||
$alice stop
|
$alice stop
|
||||||
ctx_id=$($bitcoin_cli sendrawtransaction $ctx)
|
ctx_id=$($bitcoin_cli sendrawtransaction $ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user