Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
[Qt] Optimize SendToSelf rendering with a single non-change output #11471
Conversation
jonasschnelli
added
the
GUI
label
Oct 9, 2017
promag
reviewed
Oct 9, 2017
Concept ACK.
we could show all the addresses coma separated
That sounds sensible.
| @@ -94,10 +94,25 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet * | ||
| if (fAllFromMe && fAllToMe) | ||
| { | ||
| + std::string address = ""; | ||
| + for (const CTxOut& txout : wtx.tx->vout) |
jonasschnelli
Oct 10, 2017
Member
I always try to keep the surrounding code-folding style... and here, we have \n{ everywhere.
| + std::string address = ""; | ||
| + for (const CTxOut& txout : wtx.tx->vout) | ||
| + { | ||
| + if (wallet->IsChange(txout)) |
| + { | ||
| + continue; | ||
| + } | ||
| + if (wtx.tx->vout.size() == 2) |
promag
Oct 9, 2017
Contributor
This if can be moved up to guard the for loop (avoid the loop if transaction hasn't 2 outputs).
| + if (wtx.tx->vout.size() == 2) | ||
| + { | ||
| + CTxDestination destination; | ||
| + if (ExtractDestination(txout.scriptPubKey, destination)) |
| @@ -423,6 +423,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b | ||
| case TransactionRecord::SendToOther: | ||
| return QString::fromStdString(wtx->address) + watchAddress; | ||
| case TransactionRecord::SendToSelf: | ||
| + if (wtx->address != "") { return lookupAddress(wtx->address, tooltip) + watchAddress; } |
promag
Oct 9, 2017
Contributor
if (!wtx->address.empty()) return lookupAddress(wtx->address, tooltip) + watchAddress;|
Optimizing rendering sounds good, do you have FPS numbers? :) Sorry. Concept ACK. |
|
Fixed @promag points.
Heh. Yes. Rending is maybe not the best word for decomposing a transactions. |
luke-jr
approved these changes
Nov 10, 2017
I think we should remove "Payment to yourself" (and just show a send+receive pair), but this seems like a strict improvement.
| @@ -423,6 +423,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b | ||
| case TransactionRecord::SendToOther: | ||
| return QString::fromStdString(wtx->address) + watchAddress; | ||
| case TransactionRecord::SendToSelf: | ||
| + if (!wtx->address.empty()) { return lookupAddress(wtx->address, tooltip) + watchAddress; } |

jonasschnelli commentedOct 9, 2017
Partially fixes #11464
This is a simple improvement to render singe non-change output self-to-self transactions with the corresponding output-address/label.
Multi non-change output self-to-self transaction do keep the
(n.a.)label (we could show all the addresses coma separated).Screen:
