diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-03 20:54:10 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-03 21:01:39 +0200 |
commit | 961c4a04c25237285fb9a694f8918556c690bcd6 (patch) | |
tree | 26ea6b464e942876cc509f77c3b03d79cb59f1a6 /src/main.h | |
parent | 52c1deb74549be201b63264d1a653e08c9a1cc75 (diff) | |
parent | 3f6540ad8f9c7b45a0dd2b260a282d3adad2406f (diff) |
Merge pull request #4808
3f6540a Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODS (Pieter Wuille)
47eb765 Serializer simplifications after IMPLEMENT_SERIALIZE overhaul (Pieter Wuille)
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main.h b/src/main.h index 9688b53dc4..d38d033d2c 100644 --- a/src/main.h +++ b/src/main.h @@ -197,7 +197,7 @@ struct CDiskBlockPos int nFile; unsigned int nPos; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -230,7 +230,7 @@ struct CDiskTxPos : public CDiskBlockPos { unsigned int nTxOffset; // after header - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -313,7 +313,7 @@ class CBlockUndo public: std::vector<CTxUndo> vtxundo; // for all but the coinbase - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -420,16 +420,14 @@ protected: public: // serialization implementation - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - READWRITE(nTransactions); READWRITE(vHash); std::vector<unsigned char> vBytes; - if (fRead) { + if (ser_action.ForRead()) { READWRITE(vBytes); CPartialMerkleTree &us = *(const_cast<CPartialMerkleTree*>(this)); us.vBits.resize(vBytes.size() * 8); @@ -498,7 +496,7 @@ public: uint64_t nTimeFirst; // earliest time of block in file uint64_t nTimeLast; // latest time of block in file - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -773,7 +771,7 @@ public: hashPrev = (pprev ? pprev->GetBlockHash() : 0); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -995,7 +993,7 @@ public: // thus the filter will likely be modified. CMerkleBlock(const CBlock& block, CBloomFilter& filter); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |