Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | try { | ||||
wss.nKeyMeta++; | wss.nKeyMeta++; | ||||
pwallet->GetOrCreateLegacyScriptPubKeyMan()->LoadKeyMetadata( | pwallet->GetOrCreateLegacyScriptPubKeyMan()->LoadKeyMetadata( | ||||
vchPubKey.GetID(), keyMeta); | vchPubKey.GetID(), keyMeta); | ||||
// Extract some CHDChain info from this metadata if it has any | // Extract some CHDChain info from this metadata if it has any | ||||
if (keyMeta.nVersion >= CKeyMetadata::VERSION_WITH_HDDATA && | if (keyMeta.nVersion >= CKeyMetadata::VERSION_WITH_HDDATA && | ||||
!keyMeta.hd_seed_id.IsNull() && keyMeta.hdKeypath.size() > 0) { | !keyMeta.hd_seed_id.IsNull() && keyMeta.hdKeypath.size() > 0) { | ||||
// Get the path from the key origin or from the path string | // Get the path from the key origin or from the path string | ||||
// Not applicable when path is "s" as that indicates a seed | // Not applicable when path is "s" or "m" as those indicate a | ||||
// seed. | |||||
// See https://reviews.bitcoinabc.org/D4175 | |||||
bool internal = false; | bool internal = false; | ||||
uint32_t index = 0; | uint32_t index = 0; | ||||
if (keyMeta.hdKeypath != "s") { | if (keyMeta.hdKeypath != "s" && keyMeta.hdKeypath != "m") { | ||||
std::vector<uint32_t> path; | std::vector<uint32_t> path; | ||||
if (keyMeta.has_key_origin) { | if (keyMeta.has_key_origin) { | ||||
// We have a key origin, so pull it from its path vector | // We have a key origin, so pull it from its path vector | ||||
path = keyMeta.key_origin.path; | path = keyMeta.key_origin.path; | ||||
} else { | } else { | ||||
// No key origin, have to parse the string | // No key origin, have to parse the string | ||||
if (!ParseHDKeypath(keyMeta.hdKeypath, path)) { | if (!ParseHDKeypath(keyMeta.hdKeypath, path)) { | ||||
strErr = "Error reading wallet database: keymeta " | strErr = "Error reading wallet database: keymeta " | ||||
▲ Show 20 Lines • Show All 631 Lines • Show Last 20 Lines |