Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 802 Lines • ▼ Show 20 Lines | static UniValue getreceivedbyaddress(const Config &config, | ||||
} | } | ||||
// Tally | // Tally | ||||
Amount nAmount = Amount::zero(); | Amount nAmount = Amount::zero(); | ||||
for (const std::pair<const TxId, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<const TxId, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
CValidationState state; | CValidationState state; | ||||
if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( | if (wtx.IsCoinBase() || | ||||
config, *wtx.tx, state)) { | !ContextualCheckTransactionForCurrentBlock( | ||||
config.GetChainParams().GetConsensus(), *wtx.tx, state)) { | |||||
continue; | continue; | ||||
} | } | ||||
for (const CTxOut &txout : wtx.tx->vout) { | for (const CTxOut &txout : wtx.tx->vout) { | ||||
if (txout.scriptPubKey == scriptPubKey) { | if (txout.scriptPubKey == scriptPubKey) { | ||||
if (wtx.GetDepthInMainChain() >= nMinDepth) { | if (wtx.GetDepthInMainChain() >= nMinDepth) { | ||||
nAmount += txout.nValue; | nAmount += txout.nValue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | static UniValue getreceivedbylabel(const Config &config, | ||||
std::string label = LabelFromValue(request.params[0]); | std::string label = LabelFromValue(request.params[0]); | ||||
std::set<CTxDestination> setAddress = pwallet->GetLabelAddresses(label); | std::set<CTxDestination> setAddress = pwallet->GetLabelAddresses(label); | ||||
// Tally | // Tally | ||||
Amount nAmount = Amount::zero(); | Amount nAmount = Amount::zero(); | ||||
for (const std::pair<const TxId, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<const TxId, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
CValidationState state; | CValidationState state; | ||||
if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( | if (wtx.IsCoinBase() || | ||||
config, *wtx.tx, state)) { | !ContextualCheckTransactionForCurrentBlock( | ||||
config.GetChainParams().GetConsensus(), *wtx.tx, state)) { | |||||
continue; | continue; | ||||
} | } | ||||
for (const CTxOut &txout : wtx.tx->vout) { | for (const CTxOut &txout : wtx.tx->vout) { | ||||
CTxDestination address; | CTxDestination address; | ||||
if (ExtractDestination(txout.scriptPubKey, address) && | if (ExtractDestination(txout.scriptPubKey, address) && | ||||
IsMine(*pwallet, address) && setAddress.count(address)) { | IsMine(*pwallet, address) && setAddress.count(address)) { | ||||
if (wtx.GetDepthInMainChain() >= nMinDepth) { | if (wtx.GetDepthInMainChain() >= nMinDepth) { | ||||
▲ Show 20 Lines • Show All 620 Lines • ▼ Show 20 Lines | static UniValue ListReceived(const Config &config, CWallet *const pwallet, | ||||
} | } | ||||
// Tally | // Tally | ||||
std::map<CTxDestination, tallyitem> mapTally; | std::map<CTxDestination, tallyitem> mapTally; | ||||
for (const std::pair<const TxId, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<const TxId, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
CValidationState state; | CValidationState state; | ||||
if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( | if (wtx.IsCoinBase() || | ||||
config, *wtx.tx, state)) { | !ContextualCheckTransactionForCurrentBlock( | ||||
config.GetChainParams().GetConsensus(), *wtx.tx, state)) { | |||||
continue; | continue; | ||||
} | } | ||||
int nDepth = wtx.GetDepthInMainChain(); | int nDepth = wtx.GetDepthInMainChain(); | ||||
if (nDepth < nMinDepth) { | if (nDepth < nMinDepth) { | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,803 Lines • Show Last 20 Lines |