Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | try { | ||||
// 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 == DBKeys::NAME) { | if (strType == DBKeys::NAME) { | ||||
std::string strAddress; | std::string strAddress; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssValue >> pwallet | ssValue >> pwallet | ||||
->mapAddressBook[DecodeDestination( | ->mapAddressBook[DecodeDestination( | ||||
strAddress, pwallet->chainParams)] | strAddress, pwallet->chainParams())] | ||||
.name; | .name; | ||||
} else if (strType == DBKeys::PURPOSE) { | } else if (strType == DBKeys::PURPOSE) { | ||||
std::string strAddress; | std::string strAddress; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssValue >> pwallet | ssValue >> pwallet | ||||
->mapAddressBook[DecodeDestination( | ->mapAddressBook[DecodeDestination( | ||||
strAddress, pwallet->chainParams)] | strAddress, pwallet->chainParams())] | ||||
.purpose; | .purpose; | ||||
} else if (strType == DBKeys::TX) { | } else if (strType == DBKeys::TX) { | ||||
TxId txid; | TxId txid; | ||||
ssKey >> txid; | ssKey >> txid; | ||||
CWalletTx wtx(nullptr /* pwallet */, MakeTransactionRef()); | CWalletTx wtx(nullptr /* pwallet */, MakeTransactionRef()); | ||||
ssValue >> wtx; | ssValue >> wtx; | ||||
if (wtx.GetId() != txid) { | if (wtx.GetId() != txid) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | try { | ||||
} else if (strType == DBKeys::ORDERPOSNEXT) { | } else if (strType == DBKeys::ORDERPOSNEXT) { | ||||
ssValue >> pwallet->nOrderPosNext; | ssValue >> pwallet->nOrderPosNext; | ||||
} else if (strType == DBKeys::DESTDATA) { | } else if (strType == DBKeys::DESTDATA) { | ||||
std::string strAddress, strKey, strValue; | std::string strAddress, strKey, strValue; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssKey >> strKey; | ssKey >> strKey; | ||||
ssValue >> strValue; | ssValue >> strValue; | ||||
pwallet->LoadDestData( | pwallet->LoadDestData( | ||||
DecodeDestination(strAddress, pwallet->chainParams), strKey, | DecodeDestination(strAddress, pwallet->chainParams()), strKey, | ||||
strValue); | strValue); | ||||
} else if (strType == DBKeys::HDCHAIN) { | } else if (strType == DBKeys::HDCHAIN) { | ||||
CHDChain chain; | CHDChain chain; | ||||
ssValue >> chain; | ssValue >> chain; | ||||
pwallet->GetLegacyScriptPubKeyMan()->SetHDChain(chain, true); | pwallet->GetLegacyScriptPubKeyMan()->SetHDChain(chain, true); | ||||
} else if (strType == DBKeys::FLAGS) { | } else if (strType == DBKeys::FLAGS) { | ||||
uint64_t flags; | uint64_t flags; | ||||
ssValue >> flags; | ssValue >> flags; | ||||
▲ Show 20 Lines • Show All 413 Lines • Show Last 20 Lines |