Skip to content

qt: Fix sign message address book filtering#945

Open
Bushstar wants to merge 1 commit into
bitcoin-core:masterfrom
Bushstar:bush/sign-message-address-book-test
Open

qt: Fix sign message address book filtering#945
Bushstar wants to merge 1 commit into
bitcoin-core:masterfrom
Bushstar:bush/sign-message-address-book-test

Conversation

@Bushstar

@Bushstar Bushstar commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

image
  1. In console: createwallet "watchonly" true true
  2. Select watchonly wallet in console
  3. In console: importdescriptors '[{"desc":"addr(mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn)#eccnnjdy","timestamp":"now","label":"keyless legacy"}]'
  4. In main window select the watchonly wallet
  5. Open File > Sign message....
  6. Click the address book button next to the signing address field.
  7. Actual current behavior: keyless legacy appears as a selectable signing address.
  8. Choose it, enter a message, click Sign Message.

Reproduce Receiving Addresses window stops updating

  1. In console: createwallet "non-updating"
  2. In the main window select "non-updating" wallet
  3. Open File > Sign message..., click the signing address-book button, then close the picker.
  4. In console: getnewaddress "after picker" bech32
  5. Open Window > Receiving addresses, the new address is not shown

@DrahtBot

DrahtBot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sign Message UI allows selection of keyless addresses

2 participants