mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Import PSBT: the wallet's own change is listed as a recipient and added to the total when the wallet cannot send #1117
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1117
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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 recipient list skips a wallet-owned output only when
can_sendis true (walletqmlmodel.cpp#L2869).can_sendis 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
qt6ateed1f426fcb6, 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 clearcan_send, were not run.