From 47eb76597efb7dadb36dd98bc20bd80b2db9cd50 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 1 Sep 2014 21:36:46 +0200 Subject: Serializer simplifications after IMPLEMENT_SERIALIZE overhaul --- src/main.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index 31a1131b83..1d1a9df10f 100644 --- a/src/main.h +++ b/src/main.h @@ -424,12 +424,10 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - READWRITE(nTransactions); READWRITE(vHash); std::vector vBytes; - if (fRead) { + if (ser_action.ForRead()) { READWRITE(vBytes); CPartialMerkleTree &us = *(const_cast(this)); us.vBits.resize(vBytes.size() * 8); -- cgit v1.2.3 From 3f6540ad8f9c7b45a0dd2b260a282d3adad2406f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 2 Sep 2014 09:58:09 +0200 Subject: Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODS --- src/main.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index 1d1a9df10f..6ef16c1ed1 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 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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -313,7 +313,7 @@ class CBlockUndo public: std::vector vtxundo; // for all but the coinbase - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -420,7 +420,7 @@ protected: public: // serialization implementation - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -496,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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -770,7 +770,7 @@ public: hashPrev = (pprev ? pprev->GetBlockHash() : 0); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -992,7 +992,7 @@ public: // thus the filter will likely be modified. CMerkleBlock(const CBlock& block, CBloomFilter& filter); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { -- cgit v1.2.3