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

Merge bitcoin/bitcoin#34993: wallet: `NotifyCanGetAddressesChanged` when advancing `next_index`

Public commit record

What the developer wrote

Authored by Ava Chow

91/100 · Strong
Merge bitcoin/bitcoin#34993: wallet: `NotifyCanGetAddressesChanged` when advancing `next_index`

e2ab8ae55142370f31d8606531a065e098be6c77 wallet: spkm: Only notify CanGetAddressesChanged on change (David Gumberg)
0892f16f911d0e2ac7ebf40946b74c2cef485e2c refactor: moveonly: Pair CanGetAddressesChanged notifications with desc range. (David Gumberg)
e6adae3db242a2146504bc72cf18ae58bb73401e wallet: `NotifyCanGetAddressesChanged` when advancing `next_index` (David Gumberg)

Pull request description:

Even though `TopUp()` notifies, advancing `next_index` after can deplete available addresses, so make sure to notify any time it's changed.

This would manifest as users seeing a clickable `Receive` button in the GUI when in fact no address can be generated in some edge cases, e.g. when a user has a watch only wallet with a hardened derivation path and runs out of keys.

This feels like it's begging for:

1) a refactor to make it impossible to modify `next_index` or `range_end` without firing `CanGetAddressesChanged`
2) a test

I banged my head against the keyboard for a bit but I couldn't get either of these to fall out, I also tried massaging a few clankers into doing it but I couldn't get any results that seemed reasonable to me, still seems like a worthwhile fix so opening PR anyway.

I also included a moveonly commit to pair code that can change the result of `CanGetAddresses()` with the notification firing

ACKs for top commit:
achow101:
ACK e2ab8ae55142370f31d8606531a065e098be6c77
polespinasa:
ACK e2ab8ae55142370f31d8606531a065e098be6c77
furszy:
utACK e2ab8ae55142370f31d8606531a065e098be6c77

Tree-SHA512: 5bb00d1ef4909a3e55535d283e5995df75e4288a151647f4a368b2086e2f2f4140693f43cae4f72727eafb49c9050aea8604cd6ddddc8646f7ac47b1357ed287
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This Bitcoin Core change fixes a wallet notification bug. In the GUI, the 'Receive' button could stay clickable even when the wallet had actually run out of addresses it could generate. The patch makes sure the wallet emits a 'CanGetAddressesChanged' signal whenever the next available address index advances, so the UI can disable the Receive button at the right time. It is a correctness/UI fix, not a remote code execution or theft vulnerability.

Recommended action

No urgent security action required. This is a low-severity UI-correctness fix. Users and downstream maintainers should include it in regular updates to avoid confusing GUI behavior where the Receive button appears active when no address can be generated.

Security signals we found

01

UI state desynchronization leading to user-action failure

02

Missing event notification after state mutation

03

Refactor to centralize state-change notifications

04

Watch-only wallet edge case with hardened derivation and exhausted keypool

Risk score

Why this scored 26/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/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.