Send: switching wallets can make Use maximum and payment-request paste target the wrong recipient #1045

Open
opened 2026-10-16 06:09:20 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-10-16 06:09:20 +00:00 (Migrated from github.com)

I reproduced two cases where Send shows one recipient expanded, but the action applies to another recipient after switching wallets.

Tested on qt6 at d567e3eb2497, native macOS 26.6.2 / Qt 6.9.0, using disposable regtest wallets.

For Use maximum:

  1. Load wallets A and B. B needs spendable funds and a working fee estimate or fallback fee.
  2. Add two recipient rows in each wallet’s Send form.
  3. In B, enter two different valid destinations, with 0.1 BTC for recipient 1 and 0.2 BTC for recipient 2. Leave recipient 2 expanded.
  4. Switch to A through the wallet picker and expand recipient 1.
  5. Switch back to B. Recipient 1 is now expanded. Click its Use maximum action without clicking a recipient header first.

Recipient 1 stays at 0.1 BTC, while recipient 2 gets the maximum amount. With my fixture’s available balance of 1.23297039 BTC, recipient 2 changed from 0.2 to 1.13296590 BTC.

Clicking Review Transaction and confirming the sweep warning opens a Ready to send review with those amounts. I stopped at review.

The expected result is for recipient 1 to get the remainder after fees, while recipient 2 stays at 0.2 BTC.

For payment-request paste:

  1. Restore B’s amounts to 0.1 and 0.2 BTC, then repeat steps 3–5 above, stopping before clicking Use maximum.
  2. In the visibly expanded recipient 1, select all text in the address field.
  3. Paste bitcoin:<third-valid-regtest-address>?amount=0.2, using an address different from both existing recipients.

Recipient 2’s address is replaced and its row expands. Recipient 1’s address stays unchanged. There’s no overwrite confirmation in this case either.

Pasting into recipient 1 should apply to recipient 1 and check for conflicts against its values.

Both cases come from the expanded row getting out of sync with the wallet’s current recipient. expandedRecipient is assigned during normal interaction and isn’t restored when the wallet changes. The editor displays its row’s recipient, but Use maximum and payment-request import use the wallet’s current recipient.

We should keep those selections in sync across wallet changes and have row actions explicitly target that row’s recipient. Related to #992.

I reproduced two cases where Send shows one recipient expanded, but the action applies to another recipient after switching wallets. Tested on `qt6` at [d567e3eb2497](https://github.com/bitcoin-core/gui-qml/commit/d567e3eb2497df3be5d63f4dc1f554b3bf51f59f), native macOS 26.6.2 / Qt 6.9.0, using disposable regtest wallets. For **Use maximum**: 1. Load wallets A and B. B needs spendable funds and a working fee estimate or fallback fee. 2. Add two recipient rows in each wallet’s Send form. 3. In B, enter two different valid destinations, with 0.1 BTC for recipient 1 and 0.2 BTC for recipient 2. Leave recipient 2 expanded. 4. Switch to A through the wallet picker and expand recipient 1. 5. Switch back to B. Recipient 1 is now expanded. Click its **Use maximum** action without clicking a recipient header first. Recipient 1 stays at 0.1 BTC, while recipient 2 gets the maximum amount. With my fixture’s available balance of 1.23297039 BTC, recipient 2 changed from 0.2 to **1.13296590 BTC**. Clicking Review Transaction and confirming the sweep warning opens a **Ready to send** review with those amounts. I stopped at review. The expected result is for recipient 1 to get the remainder after fees, while recipient 2 stays at 0.2 BTC. For **payment-request paste**: 1. Restore B’s amounts to 0.1 and 0.2 BTC, then repeat steps 3–5 above, stopping before clicking Use maximum. 2. In the visibly expanded recipient 1, select all text in the address field. 3. Paste `bitcoin:<third-valid-regtest-address>?amount=0.2`, using an address different from both existing recipients. Recipient 2’s address is replaced and its row expands. Recipient 1’s address stays unchanged. There’s no overwrite confirmation in this case either. Pasting into recipient 1 should apply to recipient 1 and check for conflicts against its values. Both cases come from the expanded row getting out of sync with the wallet’s current recipient. `expandedRecipient` is assigned during normal interaction and isn’t restored when the wallet changes. The editor displays its row’s recipient, but Use maximum and payment-request import use the wallet’s current recipient. We should keep those selections in sync across wallet changes and have row actions explicitly target that row’s recipient. Related to #992.
Sign in to join this conversation.
No description provided.