What changed, and why it matters
This commit only changes test scripts used in regression testing. It increases how long the tests wait for certain Bitcoin/Lightning operations to complete, from 30 seconds to 120 seconds. There is no change to the actual Electrum wallet software that users run, and no security issue is present.
No security action needed. This is a benign test-only reliability tweak.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies tests/regtest/regtest.sh, a shell script used for regtest integration tests. It bumps the timeout_sec variable from 30 to 120 in six helper functions that poll for HTLC settlement, balance updates, channel open/close states, invoice preimage availability, and UTXO spending. The commit message states the change is motivated by slow CI machines. No production code, cryptographic logic, network handling, or user-facing behavior is affected.
Changed components
tests/regtest/regtest.shInspect captured patch +6 / −6
diff --git a/tests/regtest/regtest.sh b/tests/regtest/regtest.sh
index 9bd5a9e..61873dc 100755
--- a/tests/regtest/regtest.sh
+++ b/tests/regtest/regtest.sh
@@ -22,7 +22,7 @@ function wait_until_htlcs_settled()
{
msg="wait until $1's local_unsettled_sent is zero"
cmd="./run_electrum --regtest -D /tmp/$1"
- declare -i timeout_sec=30
+ declare -i timeout_sec=120
declare -i elapsed_sec=0
while unsettled=$($cmd list_channels | jq '.[] | .local_unsettled_sent') && [ $unsettled != "0" ]; do
@@ -44,7 +44,7 @@ function wait_for_balance()
{
msg="wait until $1's balance reaches $2"
cmd="./run_electrum --regtest -D /tmp/$1"
- declare -i timeout_sec=30
+ declare -i timeout_sec=120
declare -i elapsed_sec=0
while balance=$($cmd getbalance | jq '[.confirmed, .unconfirmed] | to_entries | map(select(.value != null).value) | map(tonumber) | add ') && (( $(echo "$balance < $2" | bc -l) )); do
@@ -65,7 +65,7 @@ function wait_until_channel_open()
{
msg="wait until $1 sees channel open"
cmd="./run_electrum --regtest -D /tmp/$1"
- declare -i timeout_sec=30
+ declare -i timeout_sec=120
declare -i elapsed_sec=0
while channel_state=$($cmd list_channels | jq '.[0] | .state' | tr -d '"') && [ $channel_state != "OPEN" ]; do
@@ -86,7 +86,7 @@ function wait_until_channel_closed()
{
msg="wait until $1 sees channel closed"
cmd="./run_electrum --regtest -D /tmp/$1"
- declare -i timeout_sec=30
+ declare -i timeout_sec=120
declare -i elapsed_sec=0
while [[ $($cmd list_channels | jq '.[0].state' | tr -d '"') != "CLOSED" ]]; do
@@ -107,7 +107,7 @@ function wait_until_preimage()
{
msg="wait until $1 has preimage for $2"
cmd="./run_electrum --regtest -D /tmp/$1"
- declare -i timeout_sec=30
+ declare -i timeout_sec=120
declare -i elapsed_sec=0
while [[ $($cmd get_invoice $2 | jq '.preimage' | tr -d '"') == "null" ]]; do
@@ -127,7 +127,7 @@ function wait_until_preimage()
function wait_until_spent()
{
msg="wait until $1:$2 is spent"
- declare -i timeout_sec=30
+ declare -i timeout_sec=120
declare -i elapsed_sec=0
while [[ $($bitcoin_cli gettxout $1 $2) ]]; do
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.