Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 932 Lines • ▼ Show 20 Lines | static UniValue getbalance(const Config &config, | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
if (request.params.size() == 0) { | if (request.params.size() == 0) { | ||||
return ValueFromAmount(pwallet->GetBalance()); | return ValueFromAmount(pwallet->GetBalance()); | ||||
} | } | ||||
const std::string *account = request.params[0].get_str() != "*" | const std::string &account_param = request.params[0].get_str(); | ||||
? &request.params[0].get_str() | const std::string *account = | ||||
: nullptr; | account_param != "*" ? &account_param : nullptr; | ||||
int nMinDepth = 1; | int nMinDepth = 1; | ||||
if (!request.params[1].isNull()) { | if (!request.params[1].isNull()) { | ||||
nMinDepth = request.params[1].get_int(); | nMinDepth = request.params[1].get_int(); | ||||
} | } | ||||
isminefilter filter = ISMINE_SPENDABLE; | isminefilter filter = ISMINE_SPENDABLE; | ||||
if (!request.params[2].isNull() && request.params[2].get_bool()) { | if (!request.params[2].isNull() && request.params[2].get_bool()) { | ||||
▲ Show 20 Lines • Show All 3,043 Lines • Show Last 20 Lines |