mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Merge #15098: qt: Show addresses for "SendToSelf" transactions
11fdfcf7f9Show addresses for "SendToSelf" transactions (Hennadii Stepanov) Pull request description: Fix #11464 Fix #12688 Ref: #11471 by jonasschnelli Note: change addresses are not recognized (ref: https://github.com/bitcoin/bitcoin/pull/11471#discussion_r180547041) Result:  ACKs for top commit: jonasschnelli: Tested ACK11fdfcf7f9fanquake: ACK11fdfcf7f9- did the bare minimum testing. Tree-SHA512: 2678a2fdf017c376750c73fdc751b7838b0d3a970ba02e9032e4c5824494362672036c3ebf87b425aefdfe197fb952b70e4b7b6011077abb39a8bfc1ae14dfd2
This commit is contained in:
@@ -93,10 +93,14 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
|
|||||||
if (fAllFromMe && fAllToMe)
|
if (fAllFromMe && fAllToMe)
|
||||||
{
|
{
|
||||||
// Payment to self
|
// Payment to self
|
||||||
CAmount nChange = wtx.change;
|
std::string address;
|
||||||
|
for (auto it = wtx.txout_address.begin(); it != wtx.txout_address.end(); ++it) {
|
||||||
|
if (it != wtx.txout_address.begin()) address += ", ";
|
||||||
|
address += EncodeDestination(*it);
|
||||||
|
}
|
||||||
|
|
||||||
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "",
|
CAmount nChange = wtx.change;
|
||||||
-(nDebit - nChange), nCredit - nChange));
|
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, address, -(nDebit - nChange), nCredit - nChange));
|
||||||
parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument
|
parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument
|
||||||
}
|
}
|
||||||
else if (fAllFromMe)
|
else if (fAllFromMe)
|
||||||
|
|||||||
@@ -394,6 +394,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
|
|||||||
case TransactionRecord::SendToOther:
|
case TransactionRecord::SendToOther:
|
||||||
return QString::fromStdString(wtx->address) + watchAddress;
|
return QString::fromStdString(wtx->address) + watchAddress;
|
||||||
case TransactionRecord::SendToSelf:
|
case TransactionRecord::SendToSelf:
|
||||||
|
return lookupAddress(wtx->address, tooltip) + watchAddress;
|
||||||
default:
|
default:
|
||||||
return tr("(n/a)") + watchAddress;
|
return tr("(n/a)") + watchAddress;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user