Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 4,169 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
" \"address\" : \"address\", (string) The bitcoin " | " \"address\" : \"address\", (string) The bitcoin " | ||||
"address validated\n" | "address validated\n" | ||||
" \"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" | ||||
" \"solvable\" : true|false, (boolean) If the address is " | |||||
"solvable by the wallet\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 " | " \"ischange\" : true|false, (boolean) If the address " | ||||
"was used for change output\n" | "was used for change output\n" | ||||
" \"script\" : \"type\" (string, optional) The " | " \"script\" : \"type\" (string, optional) The " | ||||
"output script type. Only if \"isscript\" is true and the " | "output script type. Only if \"isscript\" is true and the " | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | UniValue getaddressinfo(const Config &config, const JSONRPCRequest &request) { | ||||
CScript scriptPubKey = GetScriptForDestination(dest); | CScript scriptPubKey = GetScriptForDestination(dest); | ||||
ret.pushKV("scriptPubKey", | ret.pushKV("scriptPubKey", | ||||
HexStr(scriptPubKey.begin(), scriptPubKey.end())); | HexStr(scriptPubKey.begin(), scriptPubKey.end())); | ||||
isminetype mine = IsMine(*pwallet, dest); | isminetype mine = IsMine(*pwallet, dest); | ||||
ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE)); | ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE)); | ||||
ret.pushKV("iswatchonly", bool(mine & ISMINE_WATCH_ONLY)); | ret.pushKV("iswatchonly", bool(mine & ISMINE_WATCH_ONLY)); | ||||
ret.pushKV("solvable", IsSolvable(*pwallet, scriptPubKey)); | |||||
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); | ||||
} | } | ||||
ret.pushKV("ischange", pwallet->IsChange(scriptPubKey)); | 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); | ||||
▲ Show 20 Lines • Show All 607 Lines • Show Last 20 Lines |