From a891d5b113975c0935ccd0c68ab44b08c98d8416 Mon Sep 17 00:00:00 2001 From: random-zebra Date: Mon, 1 Mar 2021 16:53:13 +0100 Subject: [PATCH] [RPC] Don't skip coinbases in ListReceived --- src/wallet/rpcwallet.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index a76a52013d67e..535d7fd60749d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2335,25 +2335,29 @@ UniValue ListReceived(const UniValue& params, bool by_label, int nBlockHeight) for (std::map::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;