Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | CTxDestination dest = | ||||
DecodeDestination(request.params[0].get_str(), config.GetChainParams()); | DecodeDestination(request.params[0].get_str(), config.GetChainParams()); | ||||
bool isValid = IsValidDestination(dest); | bool isValid = IsValidDestination(dest); | ||||
UniValue ret(UniValue::VOBJ); | UniValue ret(UniValue::VOBJ); | ||||
ret.pushKV("isvalid", isValid); | ret.pushKV("isvalid", isValid); | ||||
if (isValid) { | if (isValid) { | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (!GetWallets().empty() && | if (HasWallets() && IsDeprecatedRPCEnabled(gArgs, "validateaddress")) { | ||||
IsDeprecatedRPCEnabled(gArgs, "validateaddress")) { | |||||
ret.pushKVs(getaddressinfo(config, request)); | ret.pushKVs(getaddressinfo(config, request)); | ||||
} | } | ||||
#endif | #endif | ||||
if (ret["address"].isNull()) { | if (ret["address"].isNull()) { | ||||
std::string currentAddress = EncodeDestination(dest); | std::string currentAddress = EncodeDestination(dest); | ||||
ret.pushKV("address", currentAddress); | ret.pushKV("address", currentAddress); | ||||
CScript scriptPubKey = GetScriptForDestination(dest); | CScript scriptPubKey = GetScriptForDestination(dest); | ||||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |