Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
| Show First 20 Lines • Show All 279 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 >> pwallet | ssValue >> pwallet | ||||
| ->mapAddressBook[DecodeDestination( | ->mapAddressBook[DecodeDestination(strAddress, | ||||
| strAddress, pwallet->chainParams)] | pwallet->config)] | ||||
| .name; | .name; | ||||
| } else if (strType == "purpose") { | } else if (strType == "purpose") { | ||||
| std::string strAddress; | std::string strAddress; | ||||
| ssKey >> strAddress; | ssKey >> strAddress; | ||||
| ssValue >> pwallet | ssValue >> pwallet | ||||
| ->mapAddressBook[DecodeDestination( | ->mapAddressBook[DecodeDestination(strAddress, | ||||
| strAddress, pwallet->chainParams)] | pwallet->config)] | ||||
| .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() | ||||
| ▲ Show 20 Lines • Show All 193 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( | if (!pwallet->LoadDestData( | ||||
| DecodeDestination(strAddress, pwallet->chainParams), strKey, | DecodeDestination(strAddress, pwallet->config), 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)) { | ||||
| ▲ Show 20 Lines • Show All 382 Lines • Show Last 20 Lines | |||||