Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.
Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.
This is a small bug-fix patch for Electrum's QML (mobile-style) graphical interface. The crash reporter was not correctly handling exceptions that come from Python's threading system, which could cause the crash reporter itself to misbehav…
Fixes incorrect exception argument handling in crash reporterPrevents potential secondary failure in error-reporting pathNo security boundary crossed; no input from untrusted source is processed
This commit fixes a bug in Electrum's mobile-style QML crash reporter. When an uncaught exception occurred inside a background thread, the crash reporter itself would break because it expected three pieces of information but received one b…
Crash reporter failure could hide or obscure real runtime errors in background threadsNo input validation, privilege boundary, or cryptographic issue presentFix improves diagnostic fidelity but does not close an attack vector
This commit changes how Electrum creates unsigned Bitcoin transactions when an existing 'base transaction' is provided. Previously, the wallet wrongly demanded spendable coins even when the caller supplied a base transaction that already c…
Relaxation of input-source preconditionAddition of consensus-level invariant assertion (at least one input)Addition of empty-input guard before PartialTransaction construction
This commit fixes a crash in Electrum's transaction builder. If a user had only one on-chain coin (UTXO) that was just enough to meet a reserve requirement, clicking 'Max' in the send tab would hit an internal assertion and fail instead of…
Denial-of-service-like crash path triggered by user action in normal wallet stateAssertion failure reachable through GUI send flowFix converts assertion crash into handled NotEnoughFunds exception
This is a routine maintenance commit that updates many of Electrum's software building blocks (dependencies) and raises the minimum required Python version from 3.10 to 3.11. It also refreshes the Linux distribution snapshots used to build…
Dependency version bumps for security-sensitive libraries (cryptography, cffi, libffi, sqlite)Removal of an embedded PGP public key and switch to hash verification for Windows Python installer downloadsBase image refresh from EOL/near-EOL Debian bullseye to bookworm for AppImage builds
This commit is a straightforward internal cleanup: it moves repeated checks like 'are we running on Windows?', 'are we on Android?', and 'are we inside an AppImage?' into a single new helper module called platform.py. The actual behavior o…
This commit is a straightforward internal cleanup: it moves repeated operating-system checks (Windows, macOS, Linux, Android, AppImage) into a single new helper module called platform.py and updates the rest of the code to use those helper…
This commit only changes the software version number from 4.8.3 to 4.8.4 in a single file. It contains no security-related changes, no bug fixes, and no functional code modifications.
This commit relaxes a wallet check when creating a new Bitcoin transaction. Previously, Electrum refused to create a transaction if the user had no spendable coins and no explicit inputs. The change allows creation to continue if a 'base t…
Relaxation of input/coin availability guardAddition of post-construction input count assertionPotential workflow: Replace-By-Fee (RBF) or transaction bumping using base_tx inputs
This commit is a code cleanup in Electrum's mobile-style QML wallet wizard. It replaces an older thread-based background scan for BIP39 seed accounts with a newer asyncio-based task approach, and makes the recovery dialog destroy itself wh…
Refactor of async task lifecycle and cancellation handlingDialog lifecycle cleanup with onClosed: destroy()Use of ignore_if_destroyed to avoid callbacks on destroyed QML objects
This commit is a code cleanup in Electrum's mobile-style QML wallet wizard. It replaces an extra background thread with a simpler asyncio-based callback for scanning BIP39 seed accounts. There is no indication this fixes a security bug; it…
This commit fixes a bug in Electrum's Qt 'Send' tab where selecting a contact from the autocomplete dropdown could briefly leave the wrong recipient active. Previously, the payment field was set to a display name like 'Alice <alice@example…
UI state desynchronization between displayed recipient and active PaymentIdentifierStale PaymentIdentifier usable for ~1 second after recipient text changesPay/Save/Max buttons enabled while recipient is being edited
This commit fixes a UI bug in Electrum's QML (mobile-style) interface where transaction and address labels could become stale or fail to update after editing. It replaces a fragile manual callback system with a proper event listener so the…
No security-relevant signals in diff: no privilege escalation, injection, cryptographic, or authentication changes.Fixes a UI consistency bug (stale labels) that could mislead users but does not enable direct exploitation.Adds event-listener lifecycle management (register/unregister on destroy) to prevent dangling callbacks and potential use-after-free patterns.
This commit fixes a bug in Electrum's mobile-style QML password dialog. If a user tapped the OK/confirm button while the dialog was already closing, the app could emit an extra 'password entered' signal. That extra signal triggered a crash…
Crash in authentication-related code path (AuthMixin)Duplicate signal emission during UI state transitionUser-interaction race condition (tap while dialog closing)
This commit is a performance fix for a wallet function that traces where a transaction's funds came from. It replaces a slow, repeatedly-recursive approach with a more efficient loop and removes an old cache. The change also fixes how the …
Performance fix for wallet history traversalAddress-reuse uncle detection logic changedCache removed in favor of iterative computation
This commit fixes a bug where Electrum wallets created with unusual, hand-crafted 'old-style' seed phrases could not be opened or used. These seeds decode to an odd number of hex characters, which the program previously rejected. The chang…
Input validation relaxed for legacy data (odd-length hex strings)New user-facing error path prevents seed display when mnemonic encoding is impossibleGUI exception handling narrowed: UserFacingException shown as str, other Exception as repr
This commit is a small follow-up cleanup. It translates several user-facing error messages into different languages and makes the Qt GUI handle one specific file-read/write error (StorageReadWriteError) more gracefully, showing a warning d…
Exception-handling path changed in GUIUser-facing error messages internationalizedNo changes to encryption, wallet parsing semantics, or permissions
This commit improves Electrum's error handling when a user tries to open a file that is not a valid Electrum wallet. Previously, if the file contained bytes that were not valid UTF-8 text, the program would crash with a confusing technical…
Error-handling hardeningUser-facing exception message improvedNo cryptographic or parsing logic changed
This is a small user-interface fix in Electrum's Qt desktop app. Previously, if the wallet file was on a read-only folder or an unplugged drive, the app treated the resulting StorageReadWriteError as an unexpected crash and sent a crash re…
No memory safety, cryptographic, or authorization changesException handling change only; no new attack surface introducedCrash-reporting no longer triggered for expected I/O failure scenarios
This commit is a small follow-up cleanup in Electrum's keystore code. It renames an internal helper function, makes the code accept certain unusual 'old' seed phrases that some users created by hand, improves an error message shown to user…
Refactoring of seed validation helperUser-facing error handling improvement in seed displayGrandfathering of non-standard old seed phrases
Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.
Security candidateandroid: use plain 'build' dependency (using 'venv') instead of 'build[virtualenv]', remove setuptools as its use is now pinned via hostpython_prerequisites where applicable, update depends asserts in pyqt6sip, sip, pyqt_builderby Sander van Grieken · 9d5b4a7c · Apr 22, 2026 · 8 filesMessage 73 · AdequateInformational 14Details
Commit message · Sander van Grieken
android: use plain 'build' dependency (using 'venv') instead of 'build[virtualenv]', remove setuptools as its use is now pinned via hostpython_prerequisites where applicable, update depends asserts in pyqt6sip, sip, pyqt_builder
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive path
AI analysis · Informational 14/100
This commit updates how Electrum's Android build system installs Python packaging tools. It switches from a feature-rich 'build[virtualenv]' dependency to a simpler 'build' dependency, removes a custom pinned recipe for setuptools, and moves setuptools into a new 'hostpython_prerequisites' mechanism for some recipes. It also updates version assertions for packaging, pyqt6sip, sip, and pyqt_builder to match a newer python-for-android version. There is no direct security fix visible in the diff; it appears to be build-system maintenance.
Security candidateandroid: build pyqt_builder and sip ourselves, hash pin all hostpython_prerequisitesby Sander van Grieken · c8f5798d · Apr 22, 2026 · 6 filesMessage 50 · ThinLow 28Details
Commit message · Sander van Grieken
android: build pyqt_builder and sip ourselves, hash pin all hostpython_prerequisites
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
access control
AI analysis · Low 28/100
This commit updates the Android build setup for the Electrum Bitcoin wallet. It switches to a newer version of the python-for-android build tool, starts building two PyQt-related packages (pyqt_builder and sip) from source instead of relying on pre-built wheels, and adds cryptographic hash checks for build-time Python tools like setuptools and pip. These are supply-chain hardening changes: they make it harder for a malicious or compromised upstream package to sneak bad code into Electrum's Android app during compilation.
android: pin hostpython3 PyProjectRecipe versions, pin android and pyjnius recipes Cython version
65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Why it was queued
access control
AI analysis · Informational 18/100
This commit tightens the Android build process for the Electrum Bitcoin wallet by pinning exact versions of build tools (like Cython, pip, setuptools) and their cryptographic hashes. It also updates the version of python-for-android used. There is no direct vulnerability fix in the application code; instead, it is a supply-chain hardening change to make the build more reproducible and prevent unexpected or malicious tool updates during compilation.
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100
This commit simply bumps the Android build's Qt6 and PyQt6 libraries from version 6.10.1 to 6.10.2, along with the matching python-for-android checkout. It updates pinned version assertions and SHA-512 checksums. There is no indication in the commit itself that this fixes a security vulnerability.
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
signing or wallet pathsecond-pass: opaque commit messagesecond-pass: security-sensitive path
AI analysis · Informational 15/100
This commit simply deletes two unused user-interface files from Electrum's mobile/QML GUI. There is no indication of a security fix, vulnerability, or behavior change that affects users. It appears to be routine code cleanup.
qml: styling History, ProxyConfig and NostrConfigDialog
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100
This commit is purely a user-interface styling refresh. It changes how the History screen, Nostr relay settings dialog, and proxy configuration panel look in Electrum's QML (mobile-style) GUI. There are no changes to security logic, network handling, cryptography, or data processing.
Lower-priorityqml: use standard Button for buttons outside of buttoncontainerby Sander van Grieken · 87bb63e4 · Apr 22, 2026 · 3 filesMessage 50 · ThinInformational 15Details
Commit message · Sander van Grieken
qml: use standard Button for buttons outside of buttoncontainer
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100
This commit is a user-interface cleanup in Electrum's mobile/QML app. It replaces custom-styled button wrappers with the standard Button component in three screens: channel freeze controls, swap provider selection, and wallet recovery. There is no security change—only visual consistency and simpler code.
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100
This commit is a cosmetic UI layout fix for the Electrum mobile/desktop QML interface. It wraps several dialog buttons in a 'DialogButtonContainer' component and adjusts spacing. There is no indication it fixes a security vulnerability, changes access controls, or alters how money or secrets are handled.
AI review queuedstyling OpenChannelDialogby Sander van Grieken · 1c0851c6 · Apr 22, 2026 · 1 fileMessage 25 · OpaqueInformational 15Details
Commit message · Sander van Grieken
styling OpenChannelDialog
25/100 · OpaqueMessage clarity
✓ Descriptive subject! Too few words to establish purpose! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100
This commit is a purely cosmetic restyling of a user-interface dialog in Electrum's mobile/QML app. It rearranges the text box, buttons, and labels used when opening a Lightning payment channel, but does not change any security logic, validation, or data handling.
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
cryptography-sensitive pathseed or entropy pathsigning or wallet path
AI analysis · Informational 15/100
This commit is a routine user-interface refresh for Electrum's mobile/desktop QML app, adjusting colors, spacing, button containers, and placeholder text to match newer Qt 6.10 styling. There is no security-relevant change and no indication it fixes or introduces a vulnerability.
Lower-priorityandroid: upgrade to androidx.core:core:1.16.0 from com.android.support:support-compat:28.0.0by Sander van Grieken · 4d55b049 · Apr 22, 2026 · 1 fileMessage 50 · ThinLow 26Details
Commit message · Sander van Grieken
android: upgrade to androidx.core:core:1.16.0 from com.android.support:support-compat:28.0.0
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 26/100
This commit updates one Android support library used by the Electrum mobile app from an older Google library to a newer equivalent. It is a routine dependency migration (Android Support Library to AndroidX). The change itself does not visibly add or remove app features, and there is no direct evidence in the commit that it fixes a specific security bug. However, staying on old, unmaintained support libraries can leave apps exposed to known vulnerabilities over time, so the change is plausibly security-relevant as general hygiene.
Lower-priorityandroid: update for rebase p4a, update qt to 6.10, ndk to 28by Sander van Grieken · dba6b751 · Apr 22, 2026 · 13 filesMessage 65 · AdequateInformational 15Details
Commit message · Sander van Grieken
android: update for rebase p4a, update qt to 6.10, ndk to 28
p4a rebased on spesmilo/electrum_202602, 375a05de21b538d704174b1efeb3fc85d151f94e
65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100
This commit is a routine Android build-system maintenance update for the Electrum Bitcoin wallet. It upgrades the Android NDK, SDK tools, build tools, API level, Qt framework, Python packaging tools, and cryptographic library (OpenSSL) used to build the Android app. There is no indication in the commit message or diff of a security bug, vulnerability fix, or malicious change. It appears to be a dependency refresh to keep the build current.
Lower-priorityandroid: minimum API 26 required for Qt6.10 (Android 8.0)by Sander van Grieken · 42472a1e · Apr 22, 2026 · 1 fileMessage 50 · ThinInformational 19Details
Commit message · Sander van Grieken
android: minimum API 26 required for Qt6.10 (Android 8.0)
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 19/100
This commit simply raises the minimum Android version required to run the Electrum app from Android 6.0 (API 23) to Android 8.0 (API 26). The change is needed because the newer Qt 6.10 library used by the app no longer supports older Android versions. This is a routine compatibility/configuration update, not a security fix.
Lower-priorityicons: square closebutton.png and copy_bw.png so they don't resize on highlight (qml) and upscale qrcode-[_white].png for the same reason and so we don't need to apply scalingby Sander van Grieken · 7c83e749 · Apr 22, 2026 · 9 filesMessage 73 · AdequateInformational 15Details
Commit message · Sander van Grieken
icons: square closebutton.png and copy_bw.png so they don't resize on highlight (qml) and upscale qrcode-[_white].png for the same reason and so we don't need to apply scaling
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This commit only changes icon images and removes a visual scaling setting in the mobile/QML user interface. It fixes a minor cosmetic issue where icons would appear to resize when highlighted. There is no security relevance.
Lower-priorityqml: don't import QtMultimedia when running on android (android 8 compat)by Sander van Grieken · fd5b8676 · Apr 22, 2026 · 2 filesMessage 50 · ThinInformational 18Details
Commit message · Sander van Grieken
qml: don't import QtMultimedia when running on android (android 8 compat)
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 18/100
This is a compatibility fix for Electrum's Android app. It stops loading the QtMultimedia camera module on Android because it causes crashes on older Android versions (Android 8). The QR-code scanner is still available on desktop. There is no direct security vulnerability being patched here; it is primarily a stability/compatibility change.
Lower-priorityqml: add type hints for QVariant pyqtProperty workaroundsby Sander van Grieken · f2e8b466 · Apr 22, 2026 · 8 filesMessage 50 · ThinInformational 15Details
Commit message · Sander van Grieken
qml: add type hints for QVariant pyqtProperty workarounds
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100
This commit only adds Python type hints (annotations like `-> QEWallet` and `-> QEAmount`) to existing QML GUI property getter and setter methods. It does not change any runtime behavior, logic, or security checks. There is no security issue here.
✓ Subject identifies a change✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Low 27/100
This commit changes the version of OpenSSL used in Electrum's Android build from 3.3.1 to 3.0.18. It also removes a safety check that ensured the expected version was being used. The change appears to be a downgrade to an older OpenSSL version, which could reintroduce known security vulnerabilities that were fixed in newer releases. However, the commit message gives no explanation, and no security advisory or vendor statement is supplied.
AI review queuedqml: various styling updatesby Sander van Grieken · 3c5dc660 · Apr 22, 2026 · 3 filesMessage 35 · OpaqueInformational 15Details
Commit message · Sander van Grieken
qml: various styling updates
35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100
This commit makes small visual styling changes to three QML user-interface files in Electrum's mobile-style GUI. It adds a navigation bar background color property and sets background colors on two info text areas, plus adjusts spacing in a dialog. There is no indication these changes affect security, data handling, cryptography, or network behavior.
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
seed or entropy path
AI analysis · Informational 15/100
This commit is purely a user-interface styling update for Electrum's QML (mobile-style) screens. It changes how password prompts and wallet setup wizards look—moving labels into placeholder text, adjusting margins, and making buttons a consistent touch-friendly height. There is no change to security logic, cryptography, or how passwords/seeds are handled.
Security candidateqml: add workarounds for issue assigning custom types to QObject propertiesby Sander van Grieken · 9772a6d5 · Apr 22, 2026 · 24 filesMessage 73 · AdequateLow 25Details
Commit message · Sander van Grieken
qml: add workarounds for issue assigning custom types to QObject properties
- on the python side, for pyqtProperty's with a setter, the pyqtProperty should be declared as QVariant type - on the qml side, properties should be declared 'var', not the custom type.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundarysigning or wallet path
AI analysis · Low 25/100
This commit changes how the Electrum mobile/desktop QML GUI passes custom data objects between Python and the user interface. It switches many typed properties to the generic QVariant/'var' type and adds runtime type checks (asserts) in Python setters. The stated goal is to work around a Qt/PyQt bug where assigning custom Python types to QML properties fails. The changes are defensive and reduce strict compile-time type safety in favor of runtime checks. There is no direct evidence in the commit that this fixes an exploitable security vulnerability; it appears to be a compatibility/stability fix.
Lower-priorityci: bump code review ci claude version 4.6 -> 4.7by f321x · 1ba31448 · Apr 21, 2026 · 1 fileMessage 72 · AdequateInformational 15Details
Commit message · f321x
ci: bump code review ci claude version 4.6 -> 4.7
An improved Claude Opus version got released, this bumps the code review CI to use it.
72/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body
AI analysis · Informational 15/100
This commit simply updates the version number of an AI code-review tool used in Electrum's continuous integration (CI) pipeline from Claude Opus 4.6 to 4.7. It does not change any wallet, networking, or cryptographic code that end users rely on. There is no indication of a security fix or vulnerability.
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 22/100
This commit is a privacy improvement, not a security fix for an attack. It adds a small helper that truncates Bitcoin addresses before putting them into error messages. The goal is to protect users if those error messages are sent to a crash reporter or shown in logs, so that full addresses (which could identify transactions or balances) are not leaked. No vulnerability is being patched.
AI review queuedwallet_db: put 'genesis_blockhash' in DB, detect mainnet/testnet mixupby SomberNight · 45458c2f · Apr 20, 2026 · 3 filesMessage 98 · StrongLow 27Details
Commit message · SomberNight
wallet_db: put 'genesis_blockhash' in DB, detect mainnet/testnet mixup
If the user tries to open a wallet for a different chain (mainnet vs testnet), try to show a reasonable error message.
See previous attempt at this: https://github.com/spesmilo/electrum/commit/c13e05770150c5210783c3d42d3d2b1a683f18b4, which added `wallet.test_addresses_sanity()`. However there are many codepaths where "random" exceptions might get raised before the Wallet object is even instantiated. See [discussion there](https://github.com/spesmilo/electrum/commit/c13e05770150c5210783c3d42d3d2b1a683f18b4#commitcomment-28017341): > should we actually fix that? > if yes, it would be better to write the network type in storage
Indeed now I think we should do that. At the time I was concerned it would not help against altcoin forks if we put "mainnet" or "testnet" in the DB. Now I realise we should just put the genesis block hash in the DB instead.
Many of the reports in https://github.com/spesmilo/electrum/issues/6526 are likely due to users trying to open a mainnet wallet in testnet mode or vice-versa.
fixes https://github.com/spesmilo/electrum/issues/9134 same issue in wizard 2fa two-step wallet-creation flow
98/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 27/100
This commit improves Electrum so that when a user accidentally opens a wallet created for one Bitcoin network (mainnet) while running Electrum configured for another (testnet), they get a clear error message instead of confusing crashes. It stores the network's genesis block hash inside the wallet file and checks it on load. It is a defensive hardening change, not a fix for an active security vulnerability or exploit.
wallet: make_unsigned_tx: fix base_tx for GUI simple-send batching
fixes regression from https://github.com/spesmilo/electrum/commit/a9f20e4d3de9848247a9079b5b164d8006cf80db : For the GUI / manual new tx constructions usecase, the flow relies on `base_tx.add_info_from_wallet(self)` being called before `base_tx_fee = base_tx.get_fee()`.
fixes https://github.com/spesmilo/electrum/issues/10587 maybe fixes https://github.com/spesmilo/electrum/issues/8876 probably not a full fix: base_tx could have inputs for which add_info_from_wallet is not sufficient
91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 34/100
This commit fixes a bug in Electrum's Bitcoin wallet where combining a new payment with an existing unconfirmed transaction (a feature called RBF batching) could fail or compute fees incorrectly. The root cause was that the code tried to read the existing transaction's fee before it had loaded all the necessary wallet information about that transaction's inputs. The fix reorders the code so the wallet enriches the transaction first, then reads its fee. It also adds a safety check to skip transactions whose confirmation status is unknown when looking for batching candidates.
tests: lnpeer: fix flaky test "hold_invoice_set_doesnt_get_expired"
This test was flaky: the mpp_set resolution gets set to SETTLING several asyncio event loop iterations before the hold invoice callback "cb" gets called. If the 0.1 sec polling triggers just in the middle of that interval, `assert cb_got_called` fails.
``` async def check_mpp_state(): async def wait_for_resolution(): while True: await asyncio.sleep(0.1) if payment_key not in bob_w.received_mpp_htlcs: continue if not bob_w.received_mpp_htlcs[payment_key].resolution == RecvMPPResolution.SETTLING: continue return await util.wait_for2(wait_for_resolution(), timeout=2) > assert cb_got_called E assert False
tests/test_lnpeer.py:1898: AssertionError ```
see https://github.com/spesmilo/electrum/blob/16c8cb50e38c274cce8f9f66f28d8dd453f9f074/electrum/lnpeer.py#L3136-L3137
diff to reproduce the failure without present patch: ``` diff --git a/tests/test_lnpeer.py b/tests/test_lnpeer.py index 8669931c24..e15973d68f 100644 --- a/tests/test_lnpeer.py +++ b/tests/test_lnpeer.py @@ -1885,6 +1885,7 @@ class TestPeerDirect(TestPeer): cb_got_called = False async def cb(_payment_hash): self.logger.debug(f"hold invoice callback called. {bob_w.network.get_local_height()=}") + await asyncio.sleep(1) nonlocal cb_got_called cb_got_called = True ```
91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 15/100
This commit fixes a timing problem in a single automated test for the Lightning Network peer code. It does not change any production code, wallet behavior, or network handling. The fix makes the test wait for a callback event instead of polling every 0.1 seconds, which removes a race condition that could cause the test to fail randomly. There is no security impact for Electrum users.