Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 280 Lines • ▼ Show 20 Lines | try { | ||||
// Unserialize | // Unserialize | ||||
// Taking advantage of the fact that pair serialization is just the two | // Taking advantage of the fact that pair serialization is just the two | ||||
// items serialized one after the other. | // items serialized one after the other. | ||||
ssKey >> strType; | ssKey >> strType; | ||||
if (strType == "name") { | if (strType == "name") { | ||||
std::string strAddress; | std::string strAddress; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssValue >> | ssValue >> | ||||
pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()].name; | pwallet->mapAddressBook[DecodeDestination(strAddress)].name; | ||||
} else if (strType == "purpose") { | } else if (strType == "purpose") { | ||||
std::string strAddress; | std::string strAddress; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssValue >> | ssValue >> | ||||
pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()] | pwallet->mapAddressBook[DecodeDestination(strAddress)].purpose; | ||||
.purpose; | |||||
} else if (strType == "tx") { | } else if (strType == "tx") { | ||||
uint256 hash; | uint256 hash; | ||||
ssKey >> hash; | ssKey >> hash; | ||||
CWalletTx wtx; | CWalletTx wtx; | ||||
ssValue >> wtx; | ssValue >> wtx; | ||||
CValidationState state; | CValidationState state; | ||||
bool isValid = wtx.IsCoinBase() | bool isValid = wtx.IsCoinBase() | ||||
? CheckCoinbase(wtx, state) | ? CheckCoinbase(wtx, state) | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | try { | ||||
} | } | ||||
} else if (strType == "orderposnext") { | } else if (strType == "orderposnext") { | ||||
ssValue >> pwallet->nOrderPosNext; | ssValue >> pwallet->nOrderPosNext; | ||||
} else if (strType == "destdata") { | } else if (strType == "destdata") { | ||||
std::string strAddress, strKey, strValue; | std::string strAddress, strKey, strValue; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssKey >> strKey; | ssKey >> strKey; | ||||
ssValue >> strValue; | ssValue >> strValue; | ||||
if (!pwallet->LoadDestData(CBitcoinAddress(strAddress).Get(), | if (!pwallet->LoadDestData(DecodeDestination(strAddress), strKey, | ||||
strKey, strValue)) { | strValue)) { | ||||
strErr = "Error reading wallet database: LoadDestData failed"; | strErr = "Error reading wallet database: LoadDestData failed"; | ||||
return false; | return false; | ||||
} | } | ||||
} else if (strType == "hdchain") { | } else if (strType == "hdchain") { | ||||
CHDChain chain; | CHDChain chain; | ||||
ssValue >> chain; | ssValue >> chain; | ||||
if (!pwallet->SetHDChain(chain, true)) { | if (!pwallet->SetHDChain(chain, true)) { | ||||
strErr = "Error reading wallet database: SetHDChain failed"; | strErr = "Error reading wallet database: SetHDChain failed"; | ||||
▲ Show 20 Lines • Show All 393 Lines • Show Last 20 Lines |