Two bugs here found when signing some pretty ancient addresses! Fixed in one PR as they share the same root cause and code path.
This PR fixes sign message address selection so it only shows signable legacy addresses and no longer mutates the wallet’s shared address book model.
The problem was that the sign message picker used WalletModel::refresh(bool pk_hash_only) as a filter, it was was too loose a filter and it replaced the wallet's shared address book model leaving other views stale.
The fix is one change, stop mutating the shared wallet model and give the signing picker its own local filter.
This is related it seems and could be closed: #62
Reproduce address picker showing invalid addresses
<img width="1456" height="890" alt="image" src="https://github.com/user-attachments/assets/91fbffa1-e0cd-47f8-baf7-b00f330357cf" />
- In console:
createwallet "watchonly" true true - Select watchonly wallet in console
- In console:
importdescriptors '[{"desc":"addr(mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn)#eccnnjdy","timestamp":"now","label":"keyless legacy"}]' - In main window select the watchonly wallet
- Open File > Sign message....
- Click the address book button next to the signing address field.
- Actual current behavior: keyless legacy appears as a selectable signing address.
- Choose it, enter a message, click Sign Message.
Reproduce Receiving Addresses window stops updating
- In console:
createwallet "non-updating" - In the main window select "non-updating" wallet
- Open File > Sign message..., click the signing address-book button, then close the picker.
- In console:
getnewaddress "after picker" bech32 - Open Window > Receiving addresses, the new address is not shown