Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | static UniValue getrawchangeaddress(const Config &config, | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (!pwallet->CanGetAddresses(true)) { | if (!pwallet->CanGetAddresses(true)) { | ||||
throw JSONRPCError(RPC_WALLET_ERROR, | throw JSONRPCError(RPC_WALLET_ERROR, | ||||
"Error: This wallet has no available keys"); | "Error: This wallet has no available keys"); | ||||
} | } | ||||
OutputType output_type = | OutputType output_type = pwallet->m_default_change_type.value_or( | ||||
pwallet->m_default_change_type != OutputType::CHANGE_AUTO | pwallet->m_default_address_type); | ||||
? pwallet->m_default_change_type | |||||
: pwallet->m_default_address_type; | |||||
if (!request.params[0].isNull()) { | if (!request.params[0].isNull()) { | ||||
if (!ParseOutputType(request.params[0].get_str(), output_type)) { | if (!ParseOutputType(request.params[0].get_str(), output_type)) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
strprintf("Unknown address type '%s'", | strprintf("Unknown address type '%s'", | ||||
request.params[0].get_str())); | request.params[0].get_str())); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,703 Lines • Show Last 20 Lines |