Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | try { | ||||
ssValue >> vchPrivKey; | ssValue >> vchPrivKey; | ||||
wss.nCKeys++; | wss.nCKeys++; | ||||
if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) { | if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) { | ||||
strErr = "Error reading wallet database: LoadCryptedKey failed"; | strErr = "Error reading wallet database: LoadCryptedKey failed"; | ||||
return false; | return false; | ||||
} | } | ||||
wss.fIsEncrypted = true; | wss.fIsEncrypted = true; | ||||
} else if (strType == "keymeta" || strType == "watchmeta") { | } else if (strType == "keymeta") { | ||||
CTxDestination keyID; | |||||
if (strType == "keymeta") { | |||||
CPubKey vchPubKey; | CPubKey vchPubKey; | ||||
ssKey >> vchPubKey; | ssKey >> vchPubKey; | ||||
keyID = vchPubKey.GetID(); | CKeyMetadata keyMeta; | ||||
ssValue >> keyMeta; | |||||
wss.nKeyMeta++; | |||||
pwallet->LoadKeyMetadata(vchPubKey.GetID(), keyMeta); | |||||
} else if (strType == "watchmeta") { | } else if (strType == "watchmeta") { | ||||
CScript script; | CScript script; | ||||
ssKey >> script; | ssKey >> script; | ||||
keyID = CScriptID(script); | |||||
} | |||||
CKeyMetadata keyMeta; | CKeyMetadata keyMeta; | ||||
ssValue >> keyMeta; | ssValue >> keyMeta; | ||||
wss.nKeyMeta++; | wss.nKeyMeta++; | ||||
pwallet->LoadScriptMetadata(CScriptID(script), keyMeta); | |||||
pwallet->LoadKeyMetadata(keyID, keyMeta); | |||||
} else if (strType == "defaultkey") { | } else if (strType == "defaultkey") { | ||||
// We don't want or need the default key, but if there is one set, | // We don't want or need the default key, but if there is one set, | ||||
// we want to make sure that it is valid so that we can detect | // we want to make sure that it is valid so that we can detect | ||||
// corruption | // corruption | ||||
CPubKey vchPubKey; | CPubKey vchPubKey; | ||||
ssValue >> vchPubKey; | ssValue >> vchPubKey; | ||||
if (!vchPubKey.IsValid()) { | if (!vchPubKey.IsValid()) { | ||||
strErr = "Error reading wallet database: Default Key corrupt"; | strErr = "Error reading wallet database: Default Key corrupt"; | ||||
▲ Show 20 Lines • Show All 423 Lines • Show Last 20 Lines |