Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | #ifdef ENABLE_WALLET | ||||
ret.pushKV("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true : false); | ret.pushKV("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true : false); | ||||
UniValue detail = | UniValue detail = | ||||
boost::apply_visitor(DescribeAddressVisitor(pwallet), dest); | boost::apply_visitor(DescribeAddressVisitor(pwallet), dest); | ||||
ret.pushKVs(detail); | ret.pushKVs(detail); | ||||
if (pwallet && pwallet->mapAddressBook.count(dest)) { | if (pwallet && pwallet->mapAddressBook.count(dest)) { | ||||
ret.pushKV("account", pwallet->mapAddressBook[dest].name); | ret.pushKV("account", pwallet->mapAddressBook[dest].name); | ||||
} | } | ||||
if (pwallet) { | if (pwallet) { | ||||
const auto &meta = pwallet->mapKeyMetadata; | const CKeyMetadata *meta = nullptr; | ||||
const CKeyID *keyID = boost::get<CKeyID>(&dest); | if (const CKeyID *key_id = boost::get<CKeyID>(&dest)) { | ||||
auto it = keyID ? meta.find(*keyID) : meta.end(); | auto it = pwallet->mapKeyMetadata.find(*key_id); | ||||
if (it == meta.end()) { | if (it != pwallet->mapKeyMetadata.end()) { | ||||
it = meta.find(CScriptID(scriptPubKey)); | meta = &it->second; | ||||
} | } | ||||
if (it != meta.end()) { | } | ||||
ret.pushKV("timestamp", it->second.nCreateTime); | if (!meta) { | ||||
if (!it->second.hdKeypath.empty()) { | auto it = | ||||
ret.pushKV("hdkeypath", it->second.hdKeypath); | pwallet->m_script_metadata.find(CScriptID(scriptPubKey)); | ||||
ret.pushKV("hdmasterkeyid", | if (it != pwallet->m_script_metadata.end()) { | ||||
it->second.hdMasterKeyID.GetHex()); | meta = &it->second; | ||||
} | |||||
} | |||||
if (meta) { | |||||
ret.pushKV("timestamp", meta->nCreateTime); | |||||
if (!meta->hdKeypath.empty()) { | |||||
ret.pushKV("hdkeypath", meta->hdKeypath); | |||||
ret.pushKV("hdmasterkeyid", meta->hdMasterKeyID.GetHex()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |