Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | static bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, | ||||
try { | 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 == DBKeys::NAME) { | if (strType == DBKeys::NAME) { | ||||
std::string strAddress; | std::string strAddress; | ||||
ssKey >> strAddress; | ssKey >> strAddress; | ||||
ssValue >> pwallet | std::string label; | ||||
->mapAddressBook[DecodeDestination( | ssValue >> label; | ||||
strAddress, pwallet->chainParams)] | pwallet | ||||
.name; | ->m_address_book[DecodeDestination(strAddress, | ||||
pwallet->chainParams)] | |||||
.SetLabel(label); | |||||
} 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( | ->m_address_book[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) { | ||||
▲ Show 20 Lines • Show All 598 Lines • Show Last 20 Lines |