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
This commit is contained in:
Hennadii Stepanov 2023-07-16 19:34:28 +01:00 committed by pasta
parent 70cbd3f8a2
commit e3bbd1a46e
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38

View File

@ -175,6 +175,8 @@ std::string PSBTOperationsDialog::renderTransaction(const PartiallySignedTransac
tx_description.append(tr(" * Sends %1 to %2") tx_description.append(tr(" * Sends %1 to %2")
.arg(BitcoinUnits::formatWithUnit(BitcoinUnits::DASH, out.nValue)) .arg(BitcoinUnits::formatWithUnit(BitcoinUnits::DASH, out.nValue))
.arg(QString::fromStdString(EncodeDestination(address)))); .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("<br>"); tx_description.append("<br>");
} }