Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 4,896 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
" \"scriptPubKey\" : \"hex\", (string) The hex encoded " | " \"scriptPubKey\" : \"hex\", (string) The hex encoded " | ||||
"scriptPubKey generated by the address\n" | "scriptPubKey generated by the address\n" | ||||
" \"ismine\" : true|false, (boolean) If the address is " | " \"ismine\" : true|false, (boolean) If the address is " | ||||
"yours or not\n" | "yours or not\n" | ||||
" \"iswatchonly\" : true|false, (boolean) If the address is " | " \"iswatchonly\" : true|false, (boolean) If the address is " | ||||
"watchonly\n" | "watchonly\n" | ||||
" \"isscript\" : true|false, (boolean) If the key is a " | " \"isscript\" : true|false, (boolean) If the key is a " | ||||
"script\n" | "script\n" | ||||
" \"ischange\" : true|false, (boolean) If the address was " | |||||
"used for change output\n" | |||||
" \"script\" : \"type\" (string, optional) The output " | " \"script\" : \"type\" (string, optional) The output " | ||||
"script type. Only if \"isscript\" is true and the redeemscript is " | "script type. Only if \"isscript\" is true and the redeemscript is " | ||||
"known. Possible types: nonstandard, pubkey, pubkeyhash, " | "known. Possible types: nonstandard, pubkey, pubkeyhash, " | ||||
"scripthash, multisig, nulldata\n" | "scripthash, multisig, nulldata\n" | ||||
" \"hex\" : \"hex\", (string, optional) The " | " \"hex\" : \"hex\", (string, optional) The " | ||||
"redeemscript for the p2sh address\n" | "redeemscript for the p2sh address\n" | ||||
" \"pubkeys\" (string, optional) Array of " | " \"pubkeys\" (string, optional) Array of " | ||||
"pubkeys associated with the known redeemscript (only if " | "pubkeys associated with the known redeemscript (only if " | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | UniValue getaddressinfo(const Config &config, const JSONRPCRequest &request) { | ||||
UniValue detail = DescribeWalletAddress(pwallet, dest); | UniValue detail = DescribeWalletAddress(pwallet, dest); | ||||
ret.pushKVs(detail); | ret.pushKVs(detail); | ||||
if (pwallet->mapAddressBook.count(dest)) { | if (pwallet->mapAddressBook.count(dest)) { | ||||
ret.pushKV("label", pwallet->mapAddressBook[dest].name); | ret.pushKV("label", pwallet->mapAddressBook[dest].name); | ||||
if (IsDeprecatedRPCEnabled(gArgs, "accounts")) { | if (IsDeprecatedRPCEnabled(gArgs, "accounts")) { | ||||
ret.pushKV("account", pwallet->mapAddressBook[dest].name); | ret.pushKV("account", pwallet->mapAddressBook[dest].name); | ||||
} | } | ||||
} | } | ||||
ret.pushKV("ischange", pwallet->IsChange(scriptPubKey)); | |||||
const CKeyMetadata *meta = nullptr; | const CKeyMetadata *meta = nullptr; | ||||
CKeyID key_id = GetKeyForDestination(*pwallet, dest); | CKeyID key_id = GetKeyForDestination(*pwallet, dest); | ||||
if (!key_id.IsNull()) { | if (!key_id.IsNull()) { | ||||
auto it = pwallet->mapKeyMetadata.find(key_id); | auto it = pwallet->mapKeyMetadata.find(key_id); | ||||
if (it != pwallet->mapKeyMetadata.end()) { | if (it != pwallet->mapKeyMetadata.end()) { | ||||
meta = &it->second; | meta = &it->second; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 638 Lines • Show Last 20 Lines |