Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 608 Lines • ▼ Show 20 Lines | template <typename Stream> void Unserialize(Stream &s) { | ||||
int nVersion = s.GetVersion(); | int nVersion = s.GetVersion(); | ||||
if (!(s.GetType() & SER_GETHASH)) { | if (!(s.GetType() & SER_GETHASH)) { | ||||
s >> nVersion; | s >> nVersion; | ||||
} | } | ||||
//! Note: strAccount is serialized as part of the key, not here. | //! Note: strAccount is serialized as part of the key, not here. | ||||
s >> nCreditDebit >> nTime >> LIMITED_STRING(strOtherAccount, 65536) >> | s >> nCreditDebit >> nTime >> LIMITED_STRING(strOtherAccount, 65536) >> | ||||
LIMITED_STRING(strComment, 65536); | LIMITED_STRING(strComment, 65536); | ||||
size_t nSepPos = strComment.find("\0", 0, 1); | size_t nSepPos = strComment.find('\0', 0); | ||||
jasonbcox: pos is 0 by default. you can remove the second argument. | |||||
mapValue.clear(); | mapValue.clear(); | ||||
if (std::string::npos != nSepPos) { | if (std::string::npos != nSepPos) { | ||||
CDataStream ss(std::vector<char>(strComment.begin() + nSepPos + 1, | CDataStream ss(std::vector<char>(strComment.begin() + nSepPos + 1, | ||||
strComment.end()), | strComment.end()), | ||||
s.GetType(), s.GetVersion()); | s.GetType(), s.GetVersion()); | ||||
ss >> mapValue; | ss >> mapValue; | ||||
_ssExtra = std::vector<char>(ss.begin(), ss.end()); | _ssExtra = std::vector<char>(ss.begin(), ss.end()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 781 Lines • Show Last 20 Lines |
pos is 0 by default. you can remove the second argument.