// Taking advantage of the fact that pair serialization
// is just the two items serialized one after the other
ssKey >> strType;
+
if (strType == "name")
{
string strAddress;
// so set the wallet birthday to the beginning of time.
pwallet->nTimeFirstKey = 1;
}
+ else if (strType == "malpair")
+ {
+ string strKeyView;
+
+ CSecret vchSecret;
+ ssKey >> strKeyView;
+ ssValue >> vchSecret;
+
+ CMalleableKeyView keyView(strKeyView);
+ if (!pwallet->LoadMalleableKey(keyView, vchSecret))
+ {
+ strErr = "Error reading wallet database: LoadMalleableKey failed";
+ return false;
+ }
+ }
+ else if (strType == "malcpair")
+ {
+ string strKeyView;
+
+ std::vector<unsigned char> vchCryptedSecret;
+ ssKey >> strKeyView;
+ ssValue >> vchCryptedSecret;
+
+ CMalleableKeyView keyView(strKeyView);
+ if (!pwallet->LoadCryptedMalleableKey(keyView, vchCryptedSecret))
+ {
+ strErr = "Error reading wallet database: LoadCryptedMalleableKey failed";
+ return false;
+ }
+ }
else if (strType == "key" || strType == "wkey")
{
vector<unsigned char> vchPubKey;
}
wss.fIsEncrypted = true;
}
+ else if (strType == "malmeta")
+ {
+ string strKeyView;
+ ssKey >> strKeyView;
+
+ CMalleableKeyView keyView;
+ keyView.SetString(strKeyView);
+
+ CKeyMetadata keyMeta;
+ ssValue >> keyMeta;
+ wss.nKeyMeta++;
+
+ pwallet->LoadMalleableKeyMetadata(keyView, keyMeta);
+ }
else if (strType == "keymeta")
{
CPubKey vchPubKey;
static bool IsKeyType(string strType)
{
return (strType== "key" || strType == "wkey" ||
- strType == "mkey" || strType == "ckey");
+ strType == "mkey" || strType == "ckey" || strType == "malpair" || strType == "malcpair");
}
DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
continue;
std::vector<std::string> vstr;
- boost::split(vstr, line, boost::is_any_of(" "));
+ istringstream iss(line);
+ copy(istream_iterator<string>(iss), istream_iterator<string>(), back_inserter(vstr));
if (vstr.size() < 2)
continue;
CBitcoinSecret vchSecret;