Import PSBT: the wallet's own change is listed as a recipient and added to the total when the wallet cannot send #1117

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

When an imported PSBT is one this wallet cannot send by itself, the review lists the wallet's own change output as a recipient and adds it to the headline amount. A watch-only wallet that reopens the PSBT it just saved sees 1.00000000 BTC for a 0.1 BTC payment.

To reproduce with a watch-only wallet that holds one 1 BTC coin:

  1. Open Send, enter an address and 0.1 BTC, and click Review Transaction. Review shows one recipient and Total amount 0.10000141 BTC.
  2. Click Save transaction and close the review.
  3. Open Send → Options → Import PSBT and choose the saved file.

Review now shows two recipients: the wallet's own change address with 0.89999859 BTC, listed first, and the payee with 0.10000000 BTC. The headline and Total amount both read 1.00000000 BTC. The Transaction flow section on the same page tags that first output with the wallet's name, so the page disagrees with itself.

The same happens for a complete PSBT funded by this wallet together with another one. With 1.2 BTC paid out and 0.2999 BTC of change returning to this wallet, Review says Ready to broadcast, lists the payee and the wallet's change address as recipients, and shows Total amount 1.50000000 BTC.

Controls:

  • The first transaction, signed by the wallet that holds the keys and then imported into the watch-only wallet, shows one recipient and 0.10000141 BTC.
  • A complete PSBT that spends only this wallet's coin, with the same change address, shows one recipient.

The recipient list skips a wallet-owned output only when can_send is true (walletqmlmodel.cpp#L2869). can_send is false when not every input belongs to the wallet, and for an unsigned or partly signed PSBT when the wallet cannot sign all of the unsigned inputs (#L2842). In those cases the change is added to the recipients and to the total.

Bitcoin-Qt's PSBT dialog lists every output and marks the wallet's with "(own address)" (psbtoperationsdialog.cpp#L190-L194). Its total also includes them, so the difference there is the marking.

Expected: leave wallet-owned outputs out of the recipients and the amount in these cases too, or list them marked as the wallet's own and keep them out of the amount being sent.

No funds are at risk and the transaction itself is unchanged. #757 lists wallet-owned and change-like outputs as a row type for the planned read-only output model; this is what the current review shows without it. #1047 covers the unusable Send button on the same watch-only flow.

Reproduced on merged qt6 at eed1f426fcb6, macOS / Qt 6.9, isolated regtest, offscreen and native. The watch-only wallet was made over RPC from public descriptors, not through Add wallet, and the co-funded PSBT was built over RPC. File paths were supplied through the test-automation path fields. Nothing was broadcast. Multisig and unknown-fee imports, which also clear can_send, were not run.

When an imported PSBT is one this wallet cannot send by itself, the review lists the wallet's own change output as a recipient and adds it to the headline amount. A watch-only wallet that reopens the PSBT it just saved sees 1.00000000 BTC for a 0.1 BTC payment. To reproduce with a watch-only wallet that holds one 1 BTC coin: 1. Open **Send**, enter an address and 0.1 BTC, and click **Review Transaction**. Review shows one recipient and **Total amount** 0.10000141 BTC. 2. Click **Save transaction** and close the review. 3. Open **Send → Options → Import PSBT** and choose the saved file. Review now shows two recipients: the wallet's own change address with 0.89999859 BTC, listed first, and the payee with 0.10000000 BTC. The headline and **Total amount** both read 1.00000000 BTC. The **Transaction flow** section on the same page tags that first output with the wallet's name, so the page disagrees with itself. The same happens for a complete PSBT funded by this wallet together with another one. With 1.2 BTC paid out and 0.2999 BTC of change returning to this wallet, Review says **Ready to broadcast**, lists the payee and the wallet's change address as recipients, and shows **Total amount** 1.50000000 BTC. Controls: - The first transaction, signed by the wallet that holds the keys and then imported into the watch-only wallet, shows one recipient and 0.10000141 BTC. - A complete PSBT that spends only this wallet's coin, with the same change address, shows one recipient. The recipient list skips a wallet-owned output only when `can_send` is true ([walletqmlmodel.cpp#L2869](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/qml/models/walletqmlmodel.cpp#L2869)). `can_send` is false when not every input belongs to the wallet, and for an unsigned or partly signed PSBT when the wallet cannot sign all of the unsigned inputs ([#L2842](https://github.com/bitcoin-core/gui-qml/blob/eed1f426fcb64daa61b004590335a03afe376274/qml/models/walletqmlmodel.cpp#L2842)). In those cases the change is added to the recipients and to the total. Bitcoin-Qt's PSBT dialog lists every output and marks the wallet's with "(own address)" ([psbtoperationsdialog.cpp#L190-L194](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/qt/psbtoperationsdialog.cpp#L190-L194)). Its total also includes them, so the difference there is the marking. Expected: leave wallet-owned outputs out of the recipients and the amount in these cases too, or list them marked as the wallet's own and keep them out of the amount being sent. No funds are at risk and the transaction itself is unchanged. #757 lists wallet-owned and change-like outputs as a row type for the planned read-only output model; this is what the current review shows without it. #1047 covers the unusable Send button on the same watch-only flow. Reproduced on merged `qt6` at `eed1f426fcb6`, macOS / Qt 6.9, isolated regtest, offscreen and native. The watch-only wallet was made over RPC from public descriptors, not through Add wallet, and the co-funded PSBT was built over RPC. File paths were supplied through the test-automation path fields. Nothing was broadcast. Multisig and unknown-fee imports, which also clear `can_send`, were not run.
Sign in to join this conversation.
No description provided.