Skip to content
Merged
Changes from 1 commit
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: 7 additions & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,8 @@ struct tallyitem

static UniValue ListReceived(const CWallet& wallet, const UniValue& params, const bool by_label, const bool include_immature_coinbase) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
{
AssertLockHeld(wallet.cs_wallet);

// Minimum confirmations
int nMinDepth = 1;
if (!params[0].isNull())
Expand Down Expand Up @@ -1029,7 +1031,11 @@ static UniValue ListReceived(const CWallet& wallet, const UniValue& params, cons
UniValue ret(UniValue::VARR);
std::map<std::string, tallyitem> label_tally;

const auto& func = [&](const CTxDestination& address, const std::string& label, const std::string& purpose, bool is_change) {
const auto& func = [&](const CTxDestination& address, const std::string& label, const std::string& purpose, bool is_change)
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
{
AssertLockHeld(wallet.cs_wallet);

Copy link
Collaborator

Choose a reason for hiding this comment

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

better to remove duplicated IsMine check below, no need to add annotation then

if (is_change) return; // no change addresses
auto it = mapTally.find(address);
if (it == mapTally.end() && !fIncludeEmpty)
Expand Down