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.
This feels like it's begging for:
- a refactor to make it impossible to modify
next_indexorrange_endwithout firingCanGetAddressesChanged - 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