From e3bbd1a46e6399b6c54e83e9a33288ef9d8b7642 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 16 Jul 2023 19:34:28 +0100 Subject: [PATCH] Merge bitcoin-core/gui#740: Show own outputs on PSBT signing window 4da243ba023f2987e97fc62886c6ebc70d6ee50a qt: show own outputs on PSBT signing window (Hernan Marino) Pull request description: This fixes https://github.com/bitcoin-core/gui/issues/732 . It allows you to identify your own addresses in the outputs of a transaction in the PSBT signing window. This enables easy identification of change outputs, and prevents certain attacks where someone (co-signers of a multisig, or others ) might trick you into signing a transaction while they are stealing the change, since prior to this modification there was no easy way of knowing this. The identification of the output is similar to the way this is done in the transaction details window. A sample output is : ![image](https://github.com/bitcoin-core/gui/assets/87907936/48b8a652-7570-466b-9a34-cc0303c86d8c) ACKs for top commit: achow101: ACK 4da243ba023f2987e97fc62886c6ebc70d6ee50a jarolrod: ACK 4da243ba023f2987e97fc62886c6ebc70d6ee50a Tree-SHA512: fa9901d2acc84472c11afcd0a59a859db598cdf5cea755b492178d3e7434b70d9bd8f554928938a2ff9920c8f397fef814ce14b416556c30fba0c3c1f62cd722 --- src/qt/psbtoperationsdialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/psbtoperationsdialog.cpp b/src/qt/psbtoperationsdialog.cpp index 609f442bf2..25ac248e58 100644 --- a/src/qt/psbtoperationsdialog.cpp +++ b/src/qt/psbtoperationsdialog.cpp @@ -175,6 +175,8 @@ std::string PSBTOperationsDialog::renderTransaction(const PartiallySignedTransac tx_description.append(tr(" * Sends %1 to %2") .arg(BitcoinUnits::formatWithUnit(BitcoinUnits::DASH, out.nValue)) .arg(QString::fromStdString(EncodeDestination(address)))); + // Check if the address is one of ours + if (m_wallet_model != nullptr && m_wallet_model->wallet().txoutIsMine(out)) tx_description.append(" (" + tr("own address") + ")"); tx_description.append("
"); }