Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | static UniValue getnewaddress(const Config &config, | ||||
pwallet->LearnRelatedScripts(newKey, output_type); | pwallet->LearnRelatedScripts(newKey, output_type); | ||||
CTxDestination dest = GetDestinationForKey(newKey, output_type); | CTxDestination dest = GetDestinationForKey(newKey, output_type); | ||||
pwallet->SetAddressBook(dest, label, "receive"); | pwallet->SetAddressBook(dest, label, "receive"); | ||||
return EncodeDestination(dest, config); | return EncodeDestination(dest, config); | ||||
} | } | ||||
CTxDestination GetLabelDestination(CWallet *const pwallet, | static CTxDestination GetLabelDestination(CWallet *const pwallet, | ||||
const std::string &label, | const std::string &label, | ||||
bool bForceNew = false) { | bool bForceNew = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet) { | |||||
CTxDestination dest; | CTxDestination dest; | ||||
if (!pwallet->GetLabelDestination(dest, label, bForceNew)) { | if (!pwallet->GetLabelDestination(dest, label, bForceNew)) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_WALLET_KEYPOOL_RAN_OUT, | RPC_WALLET_KEYPOOL_RAN_OUT, | ||||
"Error: Keypool ran out, please call keypoolrefill first"); | "Error: Keypool ran out, please call keypoolrefill first"); | ||||
} | } | ||||
return dest; | return dest; | ||||
▲ Show 20 Lines • Show All 1,505 Lines • ▼ Show 20 Lines | struct tallyitem { | ||||
int nConf{std::numeric_limits<int>::max()}; | int nConf{std::numeric_limits<int>::max()}; | ||||
std::vector<uint256> txids; | std::vector<uint256> txids; | ||||
bool fIsWatchonly{false}; | bool fIsWatchonly{false}; | ||||
tallyitem() {} | tallyitem() {} | ||||
}; | }; | ||||
static UniValue ListReceived(const Config &config, CWallet *const pwallet, | static UniValue ListReceived(const Config &config, CWallet *const pwallet, | ||||
const UniValue ¶ms, bool by_label) | const UniValue ¶ms, bool by_label) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | EXCLUSIVE_LOCKS_REQUIRED(cs_main, pwallet->cs_wallet) { | ||||
// Minimum confirmations | // Minimum confirmations | ||||
int nMinDepth = 1; | int nMinDepth = 1; | ||||
if (!params[0].isNull()) { | if (!params[0].isNull()) { | ||||
nMinDepth = params[0].get_int(); | nMinDepth = params[0].get_int(); | ||||
} | } | ||||
// Whether to include empty labels | // Whether to include empty labels | ||||
bool fIncludeEmpty = false; | bool fIncludeEmpty = false; | ||||
▲ Show 20 Lines • Show All 3,726 Lines • Show Last 20 Lines |