What changed, and why it matters
This commit fixes a flaky automated test, not a security bug in the Electrum wallet. It adds a wait step so the test script doesn't check log files before background payment commands have finished writing to them. There is no change to production code or user-facing behavior.
No security action needed. Treat as a normal test reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies tests/regtest/regtest.sh in the extract_preimage regression test. It inserts a loop that waits until no GNU screen sessions whose names end in _payment are still running before reading /tmp/alice/screen1.log and /tmp/bob/screen1.log to verify payment success. This prevents a race condition where the preimage is already available but the lnpay command’s success output has not yet been flushed to the log, causing intermittent test failures. No wallet, daemon, Lightning protocol, or cryptographic code is changed.
Changed components
tests/regtest/regtest.shInspect captured patch +1 / −0
diff --git a/tests/regtest/regtest.sh b/tests/regtest/regtest.sh
index 47ee7e4..ced9f0b 100755
--- a/tests/regtest/regtest.sh
+++ b/tests/regtest/regtest.sh
@@ -566,6 +566,7 @@ if [[ $1 == "extract_preimage" ]]; then
new_blocks 1
wait_until_preimage alice $rhash1
wait_until_preimage bob $rhash2
+ while screen -ls | grep -q _payment; do sleep 1; done # wait until lnpay return before checking logs
# check both "lnpay" commands succeeded
success=$(cat /tmp/alice/screen1.log | jq -r ".success")
if [[ "$success" != "true" ]]; then echo "alice payment failed"; exit 1; fi
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.