Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 4,227 Lines • ▼ Show 20 Lines | UniValue getaddressinfo(const Config &config, const JSONRPCRequest &request) { | ||||
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)); | ||||
ScriptPubKeyMan *spk_man = pwallet->GetScriptPubKeyMan(); | ScriptPubKeyMan *spk_man = pwallet->GetScriptPubKeyMan(); | ||||
if (spk_man) { | if (spk_man) { | ||||
CKeyID key_id = GetKeyForDestination(*provider, dest); | if (const CKeyMetadata *meta = spk_man->GetMetadata(dest)) { | ||||
const CKeyMetadata *meta = nullptr; | |||||
if (!key_id.IsNull()) { | |||||
meta = spk_man->GetMetadata(key_id); | |||||
} | |||||
if (!meta) { | |||||
meta = spk_man->GetMetadata(CScriptID(scriptPubKey)); | |||||
} | |||||
if (meta) { | |||||
ret.pushKV("timestamp", meta->nCreateTime); | ret.pushKV("timestamp", meta->nCreateTime); | ||||
if (meta->has_key_origin) { | if (meta->has_key_origin) { | ||||
ret.pushKV("hdkeypath", WriteHDKeypath(meta->key_origin.path)); | ret.pushKV("hdkeypath", WriteHDKeypath(meta->key_origin.path)); | ||||
ret.pushKV("hdseedid", meta->hd_seed_id.GetHex()); | ret.pushKV("hdseedid", meta->hd_seed_id.GetHex()); | ||||
ret.pushKV("hdmasterfingerprint", | ret.pushKV("hdmasterfingerprint", | ||||
HexStr(meta->key_origin.fingerprint, | HexStr(meta->key_origin.fingerprint, | ||||
meta->key_origin.fingerprint + 4)); | meta->key_origin.fingerprint + 4)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 555 Lines • Show Last 20 Lines |