Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 1,684 Lines • ▼ Show 20 Lines | if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth) { | ||||
(::IsMine(*pwallet, r.destination) & ISMINE_WATCH_ONLY)) { | (::IsMine(*pwallet, r.destination) & ISMINE_WATCH_ONLY)) { | ||||
entry.push_back(Pair("involvesWatchonly", true)); | entry.push_back(Pair("involvesWatchonly", true)); | ||||
} | } | ||||
entry.push_back(Pair("account", account)); | entry.push_back(Pair("account", account)); | ||||
MaybePushAddress(entry, r.destination); | MaybePushAddress(entry, r.destination); | ||||
if (wtx.IsCoinBase()) { | if (wtx.IsCoinBase()) { | ||||
if (wtx.GetDepthInMainChain() < 1) { | if (wtx.GetDepthInMainChain() < 1) { | ||||
entry.push_back(Pair("category", "orphan")); | entry.push_back(Pair("category", "orphan")); | ||||
} else if (wtx.GetBlocksToMaturity() > 0) { | } else if (wtx.IsImmatureCoinBase()) { | ||||
entry.push_back(Pair("category", "immature")); | entry.push_back(Pair("category", "immature")); | ||||
} else { | } else { | ||||
entry.push_back(Pair("category", "generate")); | entry.push_back(Pair("category", "generate")); | ||||
} | } | ||||
} else { | } else { | ||||
entry.push_back(Pair("category", "receive")); | entry.push_back(Pair("category", "receive")); | ||||
} | } | ||||
entry.push_back(Pair("amount", ValueFromAmount(r.amount))); | entry.push_back(Pair("amount", ValueFromAmount(r.amount))); | ||||
▲ Show 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | static UniValue listaccounts(const Config &config, | ||||
for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
Amount nFee; | Amount nFee; | ||||
std::string strSentAccount; | std::string strSentAccount; | ||||
std::list<COutputEntry> listReceived; | std::list<COutputEntry> listReceived; | ||||
std::list<COutputEntry> listSent; | std::list<COutputEntry> listSent; | ||||
int nDepth = wtx.GetDepthInMainChain(); | int nDepth = wtx.GetDepthInMainChain(); | ||||
if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0) { | if (wtx.IsImmatureCoinBase() || nDepth < 0) { | ||||
continue; | continue; | ||||
} | } | ||||
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, | wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, | ||||
includeWatchonly); | includeWatchonly); | ||||
mapAccountBalances[strSentAccount] -= nFee; | mapAccountBalances[strSentAccount] -= nFee; | ||||
for (const COutputEntry &s : listSent) { | for (const COutputEntry &s : listSent) { | ||||
mapAccountBalances[strSentAccount] -= s.amount; | mapAccountBalances[strSentAccount] -= s.amount; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,691 Lines • Show Last 20 Lines |