Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GUI][Zerocoin] transaction list - handle receive from zerocoin transactions #946

Merged
merged 1 commit into from
May 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/qt/transactionrecord.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2011-2019 The Bitcoin Core developers
// Copyright (c) 2011-2019 The Particl developers
// Copyright (c) 2018-2019 Veil developers
// Copyright (c) 2018-2021 Veil developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -411,7 +411,11 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
if (wtx.txout_address_is_mine[i]) {
// Received by Bitcoin Address
sub.type = TransactionRecord::RecvWithAddress;
sub.address = EncodeDestination(wtx.txout_address[i]);
bool fBech32 = false;
if (boost::get<CScriptID>(&wtx.txout_address[i])){
fBech32 = true;
}
Comment on lines +414 to +417
Copy link
Collaborator

@Zannick Zannick May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Can this be condensed into a single line instead of the if? say, something like
bool fBech32 = (bool)boost::get<CScriptID>(...); or boost::get<CScriptID>(...) != ... ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true:
bool fBech32 = boost::get<CScriptID>(&wtx.txout_address[i]) would do the trick; but functionally it's the same and and it's not against style; so I'll say that's a NIT

Another NIT: space between the end of the if and the {

But given problems with this problem, I'm not concerned with holding it up.

sub.address = EncodeDestination(wtx.txout_address[i], fBech32);
} else {
// Received by IP connection (deprecated features), or a multisignature or other non-simple transaction
sub.type = TransactionRecord::RecvFromOther;
Expand Down