Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,970 Lines • ▼ Show 20 Lines | if (meta.has_key_origin) { | ||||
info.fingerprint); | info.fingerprint); | ||||
info.path = meta.key_origin.path; | info.path = meta.key_origin.path; | ||||
} else { | } else { | ||||
// Single pubkeys get the master fingerprint of themselves | // Single pubkeys get the master fingerprint of themselves | ||||
std::copy(keyID.begin(), keyID.begin() + 4, info.fingerprint); | std::copy(keyID.begin(), keyID.begin() + 4, info.fingerprint); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool CWallet::AddKeyOrigin(const CPubKey &pubkey, const KeyOriginInfo &info) { | |||||
LOCK(cs_wallet); | |||||
std::copy(info.fingerprint, info.fingerprint + 4, | |||||
mapKeyMetadata[pubkey.GetID()].key_origin.fingerprint); | |||||
mapKeyMetadata[pubkey.GetID()].key_origin.path = info.path; | |||||
mapKeyMetadata[pubkey.GetID()].has_key_origin = true; | |||||
mapKeyMetadata[pubkey.GetID()].hdKeypath = WriteHDKeypath(info.path); | |||||
return WriteKeyMetadata(mapKeyMetadata[pubkey.GetID()], pubkey, true); | |||||
} |