regtest.test_breach_with_spent_htlc: wait until settled
What changed, and why it matters
This commit only changes a regression test script. It replaces a quick check that sometimes failed with a proper wait routine, and removes an unnecessary one-second sleep. There is no change to the actual Electrum wallet or Lightning code that users run.
No security action needed. Treat as routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/regtest/regtest.sh in the breach_with_spent_htlc test case. It swaps an immediate jq query of local_unsettled_sent for a wait_until_htlcs_settled alice helper, and removes a sleep 1 between daemon restart and wallet load. These are test-flakiness fixes, not product security fixes.
Changed components
tests/regtest/regtest.shInspect captured patch +1 / −6
diff --git a/tests/regtest/regtest.sh b/tests/regtest/regtest.sh
index 84df0e1..47ee7e4 100755
--- a/tests/regtest/regtest.sh
+++ b/tests/regtest/regtest.sh
@@ -694,11 +694,7 @@ if [[ $1 == "breach_with_spent_htlc" ]]; then
fi
cp /tmp/alice/regtest/wallets/default_wallet /tmp/alice/regtest/wallets/toxic_wallet
$bob enable_htlc_settle true
- unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent')
- if [[ "$unsettled" != "0" ]]; then
- echo "enable_htlc_settle did not work, $unsettled"
- exit 1
- fi
+ wait_until_htlcs_settled alice
echo $($bob getbalance)
echo "bob goes offline"
$bob stop
@@ -715,7 +711,6 @@ if [[ $1 == "breach_with_spent_htlc" ]]; then
new_blocks 150
$alice stop
$alice daemon -d
- sleep 1
$alice load_wallet -w /tmp/alice/regtest/wallets/toxic_wallet
# wait until alice has spent both ctx outputs
echo "alice spends to_local and htlc outputs"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.