Send: moving Use maximum to a second recipient leaves the first with the old maximum and blocks Review #1115

Open
opened 2026-11-11 01:26:40 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-11 01:26:40 +00:00 (Migrated from github.com)

With two recipients, clicking Use maximum on the second after using it on the first leaves the first recipient holding the old maximum as a fixed amount. The second recipient gets no amount, and Review is disabled with a message that does not say which recipient is the problem.

To reproduce on regtest, with a 150 BTC wallet and Automatic coin selection:

  1. Open Send. For recipient 1, enter an address and click Use maximum. The amount fills with 149.99999755.
  2. Click + Add another. For recipient 2, enter an address and click Use maximum.

Afterwards:

  • Recipient 2 has an empty amount with Sending maximum available, and its Use maximum is disabled.
  • Recipient 1, now collapsed, still shows 149.99999755 BTC as a fixed amount.
  • The fee rows show a dash, Total to send is 149.99999755, and Review is disabled with Complete every recipient before continuing.

Nothing marks recipient 1's amount as left over from maximum mode. The same happens if Use maximum is clicked on recipient 1 while it still has no address at the handover; it then keeps the gross 150.00000000.

Ways out that I tried:

  • Typing a smaller amount into recipient 1 works. With 1 BTC, Review showed 1.00000000 and 148.99999724 with a 0.00000276 fee, matching Core's sendall, and both recipients were paid exactly that.
  • Removing recipient 2 leaves recipient 1 with the old amount as a fixed payment, which no longer fits. Review is enabled, but clicking it reports The total exceeds your balance when the 0.00000042 transaction fee is included. Clicking Use maximum on recipient 1 again then works.
  • Clearing recipient 1's amount is not enough on its own; it then needs a new amount.

These controls reviewed normally and matched Core: two recipients with fixed amounts, one recipient with Use maximum, and Use maximum on recipient 2 only.

setMaximumRecipient moves its connections to the new recipient and never resets the previous recipient's amount (walletqmlmodel.cpp#L803-L820). That stale amount is the whole balance less a one-output fee, so the two-output maximum preview cannot fit it (#L343-L345) and returns nothing.

Expected: when maximum mode moves to another recipient, clear the previous recipient's amount, and make the "Complete every recipient" message point at the recipient that needs attention.

No wrong payment is possible in this state, because Review is disabled. #1077 covers failed maximum previews hiding their reason, from different triggers, and #1045 is the wallet-switch case. I found no open pull request that changes setMaximumRecipient.

Reproduced on merged qt6 at eed1f426fcb6, macOS / Qt 6.9, isolated regtest with its fixed 1 sat/vB rate, offscreen and native. I first saw it at d567e3eb2497 in October; the function is unchanged since. One balance shape was tested, three 50 BTC coins. Clicks and typing went through the test bridge.

With two recipients, clicking **Use maximum** on the second after using it on the first leaves the first recipient holding the old maximum as a fixed amount. The second recipient gets no amount, and Review is disabled with a message that does not say which recipient is the problem. To reproduce on regtest, with a 150 BTC wallet and Automatic coin selection: 1. Open **Send**. For recipient 1, enter an address and click **Use maximum**. The amount fills with 149.99999755. 2. Click **+ Add another**. For recipient 2, enter an address and click **Use maximum**. Afterwards: - Recipient 2 has an empty amount with **Sending maximum available**, and its **Use maximum** is disabled. - Recipient 1, now collapsed, still shows 149.99999755 BTC as a fixed amount. - The fee rows show a dash, **Total to send** is 149.99999755, and Review is disabled with **Complete every recipient before continuing.** Nothing marks recipient 1's amount as left over from maximum mode. The same happens if **Use maximum** is clicked on recipient 1 while it still has no address at the handover; it then keeps the gross 150.00000000. Ways out that I tried: - Typing a smaller amount into recipient 1 works. With 1 BTC, Review showed 1.00000000 and 148.99999724 with a 0.00000276 fee, matching Core's `sendall`, and both recipients were paid exactly that. - Removing recipient 2 leaves recipient 1 with the old amount as a fixed payment, which no longer fits. Review is enabled, but clicking it reports **The total exceeds your balance when the 0.00000042 transaction fee is included.** Clicking **Use maximum** on recipient 1 again then works. - Clearing recipient 1's amount is not enough on its own; it then needs a new amount. These controls reviewed normally and matched Core: two recipients with fixed amounts, one recipient with Use maximum, and Use maximum on recipient 2 only. `setMaximumRecipient` moves its connections to the new recipient and never resets the previous recipient's amount ([walletqmlmodel.cpp#L803-L820](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/qml/models/walletqmlmodel.cpp#L803-L820)). That stale amount is the whole balance less a one-output fee, so the two-output maximum preview cannot fit it ([#L343-L345](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/qml/models/walletqmlmodel.cpp#L343-L345)) and returns nothing. Expected: when maximum mode moves to another recipient, clear the previous recipient's amount, and make the "Complete every recipient" message point at the recipient that needs attention. No wrong payment is possible in this state, because Review is disabled. #1077 covers failed maximum previews hiding their reason, from different triggers, and #1045 is the wallet-switch case. I found no open pull request that changes `setMaximumRecipient`. Reproduced on merged `qt6` at `eed1f426fcb6`, macOS / Qt 6.9, isolated regtest with its fixed 1 sat/vB rate, offscreen and native. I first saw it at `d567e3eb2497` in October; the function is unchanged since. One balance shape was tested, three 50 BTC coins. Clicks and typing went through the test bridge.
Sign in to join this conversation.
No description provided.