Skip to content

Commit

Permalink
[RPC] Don't skip coinbases in ListReceived
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed May 3, 2021
1 parent 8afc832 commit a891d5b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,25 +2335,29 @@ UniValue ListReceived(const UniValue& params, bool by_label, int nBlockHeight)
for (std::map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) {
const CWalletTx& wtx = (*it).second;

if (wtx.IsCoinBase() || !IsFinalTx(wtx.tx, nBlockHeight))
if (!IsFinalTx(wtx.tx, nBlockHeight)) {
continue;
}

int nDepth = wtx.GetDepthInMainChain();
if (nDepth < nMinDepth)
if (nDepth < nMinDepth) {
continue;
}

for (const CTxOut& txout : wtx.tx->vout) {
CTxDestination address;
if (!ExtractDestination(txout.scriptPubKey, address))
if (!ExtractDestination(txout.scriptPubKey, address)) {
continue;
}

if (has_filtered_address && !(filtered_address == address)) {
continue;
}

isminefilter mine = IsMine(*pwalletMain, address);
if (!(mine & filter))
if (!(mine & filter)) {
continue;
}

tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
Expand Down

0 comments on commit a891d5b

Please sign in to comment.