AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 24 Bitcoin

AddressSynchronizer: invalidate balance cache on spv

Public commit record

What the developer wrote

Authored by f321x

85/100 · Strong
AddressSynchronizer: invalidate balance cache on spv

There was a race incorrectly counting transactions with one
confirmations to the unconfirmed balance instead of the confirmed
balance.
This happened because the balance cache of AddressSynchronizer got
invalidated after `on_event_blockchain_updated` and then again after
`receive_history_callback`->`add_transaction`, however when calling
`AddressSynchronizer.get_balance()` before the tx got spv verified the
height would still be counted as 0 (unconfirmed), populating the balance
cache again with the unconfirmed balance.
I noticed this only on QML due to timing differences to Qt.
Invalidating the cache in `AddressSynchronizer.add_verified_tx()` after
the tx got verified causes the balance to get recalculated and shown
correctly.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a display-only bug in Electrum where, under certain timing conditions, a transaction that already had one blockchain confirmation could briefly be shown as 'unconfirmed' in the wallet balance. The fix adds a cache refresh right after a transaction is SPV-verified, so the balance is recalculated with the correct confirmation count. It does not allow theft, transaction manipulation, or remote code execution.

Recommended action

Treat as a routine bug fix. No urgent security response is required. Users and integrators should update to the patched version to avoid confusing balance displays, especially on QML builds.

Security signals we found

01

UI/balance display inconsistency caused by stale cache

02

Race condition between balance cache invalidation and SPV verification

03

No cryptographic, network, or authorization boundary crossed

Risk score

Why this scored 24/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 5/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.