|
|
|
@ -607,7 +607,6 @@ static UniValue getreceivedbyaddress(const JSONRPCRequest& request)
|
|
|
|
|
// the user could have gotten from another RPC command prior to now
|
|
|
|
|
pwallet->BlockUntilSyncedToCurrentChain();
|
|
|
|
|
|
|
|
|
|
LockAnnotation lock(::cs_main); // Temporary, for CheckFinalTx below. Removed in upcoming commit.
|
|
|
|
|
auto locked_chain = pwallet->chain().lock();
|
|
|
|
|
LOCK(pwallet->cs_wallet);
|
|
|
|
|
|
|
|
|
@ -630,7 +629,7 @@ static UniValue getreceivedbyaddress(const JSONRPCRequest& request)
|
|
|
|
|
CAmount nAmount = 0;
|
|
|
|
|
for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
|
|
|
|
|
const CWalletTx& wtx = pairWtx.second;
|
|
|
|
|
if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))
|
|
|
|
|
if (wtx.IsCoinBase() || !locked_chain->checkFinalTx(*wtx.tx))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
for (const CTxOut& txout : wtx.tx->vout)
|
|
|
|
@ -679,7 +678,6 @@ static UniValue getreceivedbylabel(const JSONRPCRequest& request)
|
|
|
|
|
// the user could have gotten from another RPC command prior to now
|
|
|
|
|
pwallet->BlockUntilSyncedToCurrentChain();
|
|
|
|
|
|
|
|
|
|
LockAnnotation lock(::cs_main); // Temporary, for CheckFinalTx below. Removed in upcoming commit.
|
|
|
|
|
auto locked_chain = pwallet->chain().lock();
|
|
|
|
|
LOCK(pwallet->cs_wallet);
|
|
|
|
|
|
|
|
|
@ -696,7 +694,7 @@ static UniValue getreceivedbylabel(const JSONRPCRequest& request)
|
|
|
|
|
CAmount nAmount = 0;
|
|
|
|
|
for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
|
|
|
|
|
const CWalletTx& wtx = pairWtx.second;
|
|
|
|
|
if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))
|
|
|
|
|
if (wtx.IsCoinBase() || !locked_chain->checkFinalTx(*wtx.tx))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
for (const CTxOut& txout : wtx.tx->vout)
|
|
|
|
@ -1051,8 +1049,6 @@ struct tallyitem
|
|
|
|
|
|
|
|
|
|
static UniValue ListReceived(interfaces::Chain::Lock& locked_chain, CWallet * const pwallet, const UniValue& params, bool by_label) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
|
|
|
|
|
{
|
|
|
|
|
LockAnnotation lock(::cs_main); // Temporary, for CheckFinalTx below. Removed in upcoming commit.
|
|
|
|
|
|
|
|
|
|
// Minimum confirmations
|
|
|
|
|
int nMinDepth = 1;
|
|
|
|
|
if (!params[0].isNull())
|
|
|
|
@ -1083,7 +1079,7 @@ static UniValue ListReceived(interfaces::Chain::Lock& locked_chain, CWallet * co
|
|
|
|
|
for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
|
|
|
|
|
const CWalletTx& wtx = pairWtx.second;
|
|
|
|
|
|
|
|
|
|
if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))
|
|
|
|
|
if (wtx.IsCoinBase() || !locked_chain.checkFinalTx(*wtx.tx))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
int nDepth = wtx.GetDepthInMainChain(locked_chain);
|
|
|
|
|