Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 4,658 Lines • ▼ Show 20 Lines | |||||
class DescribeWalletAddressVisitor : public boost::static_visitor<UniValue> { | class DescribeWalletAddressVisitor : public boost::static_visitor<UniValue> { | ||||
public: | public: | ||||
CWallet *const pwallet; | CWallet *const pwallet; | ||||
void ProcessSubScript(const CScript &subscript, UniValue &obj, | void ProcessSubScript(const CScript &subscript, UniValue &obj, | ||||
bool include_addresses = false) const { | bool include_addresses = false) const { | ||||
// Always present: script type and redeemscript | // Always present: script type and redeemscript | ||||
txnouttype which_type; | |||||
std::vector<std::vector<uint8_t>> solutions_data; | std::vector<std::vector<uint8_t>> solutions_data; | ||||
Solver(subscript, which_type, solutions_data); | txnouttype which_type = Solver(subscript, solutions_data); | ||||
obj.pushKV("script", GetTxnOutputType(which_type)); | obj.pushKV("script", GetTxnOutputType(which_type)); | ||||
obj.pushKV("hex", HexStr(subscript.begin(), subscript.end())); | obj.pushKV("hex", HexStr(subscript.begin(), subscript.end())); | ||||
CTxDestination embedded; | CTxDestination embedded; | ||||
UniValue a(UniValue::VARR); | UniValue a(UniValue::VARR); | ||||
if (ExtractDestination(subscript, embedded)) { | if (ExtractDestination(subscript, embedded)) { | ||||
// Only when the script corresponds to an address. | // Only when the script corresponds to an address. | ||||
UniValue subobj(UniValue::VOBJ); | UniValue subobj(UniValue::VOBJ); | ||||
▲ Show 20 Lines • Show All 812 Lines • Show Last 20 Lines |