mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
e2ab8ae551wallet: spkm: Only notify CanGetAddressesChanged on change (David Gumberg)0892f16f91refactor: moveonly: Pair CanGetAddressesChanged notifications with desc range. (David Gumberg)e6adae3db2wallet: `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: ACKe2ab8ae551polespinasa: ACKe2ab8ae551furszy: utACKe2ab8ae551Tree-SHA512: 5bb00d1ef4909a3e55535d283e5995df75e4288a151647f4a368b2086e2f2f4140693f43cae4f72727eafb49c9050aea8604cd6ddddc8646f7ac47b1357ed287