Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | static UniValue validateaddress(const Config &config, | ||||
ret.pushKV("isvalid", isValid); | ret.pushKV("isvalid", isValid); | ||||
if (isValid) { | if (isValid) { | ||||
if (ret["address"].isNull()) { | if (ret["address"].isNull()) { | ||||
std::string currentAddress = EncodeDestination(dest, config); | std::string currentAddress = EncodeDestination(dest, config); | ||||
ret.pushKV("address", currentAddress); | ret.pushKV("address", currentAddress); | ||||
CScript scriptPubKey = GetScriptForDestination(dest); | CScript scriptPubKey = GetScriptForDestination(dest); | ||||
ret.pushKV("scriptPubKey", | ret.pushKV("scriptPubKey", HexStr(scriptPubKey)); | ||||
HexStr(scriptPubKey.begin(), scriptPubKey.end())); | |||||
UniValue detail = DescribeAddress(dest); | UniValue detail = DescribeAddress(dest); | ||||
ret.pushKVs(detail); | ret.pushKVs(detail); | ||||
} | } | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | const CTxDestination dest = AddAndGetMultisigDestination( | ||||
required, pubkeys, output_type, keystore, inner); | required, pubkeys, output_type, keystore, inner); | ||||
// Make the descriptor | // Make the descriptor | ||||
std::unique_ptr<Descriptor> descriptor = | std::unique_ptr<Descriptor> descriptor = | ||||
InferDescriptor(GetScriptForDestination(dest), keystore); | InferDescriptor(GetScriptForDestination(dest), keystore); | ||||
UniValue result(UniValue::VOBJ); | UniValue result(UniValue::VOBJ); | ||||
result.pushKV("address", EncodeDestination(dest, config)); | result.pushKV("address", EncodeDestination(dest, config)); | ||||
result.pushKV("redeemScript", HexStr(inner.begin(), inner.end())); | result.pushKV("redeemScript", HexStr(inner)); | ||||
result.pushKV("descriptor", descriptor->ToString()); | result.pushKV("descriptor", descriptor->ToString()); | ||||
return result; | return result; | ||||
} | } | ||||
UniValue getdescriptorinfo(const Config &config, | UniValue getdescriptorinfo(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
▲ Show 20 Lines • Show All 595 Lines • Show Last 20 Lines |