Serializer simplifications after IMPLEMENT_SERIALIZE overhaul

This commit is contained in:
Pieter Wuille
2014-09-01 21:36:46 +02:00
parent 2e731f24b5
commit 47eb76597e
7 changed files with 43 additions and 66 deletions

View File

@@ -257,14 +257,12 @@ public:
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
bool fRead = ser_action.ForRead();
READWRITE(*const_cast<int32_t*>(&this->nVersion));
nVersion = this->nVersion;
READWRITE(*const_cast<std::vector<CTxIn>*>(&vin));
READWRITE(*const_cast<std::vector<CTxOut>*>(&vout));
READWRITE(*const_cast<uint32_t*>(&nLockTime));
if (fRead)
if (ser_action.ForRead())
UpdateHash();
}
@@ -346,8 +344,7 @@ public:
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
bool fRead = ser_action.ForRead();
if (!fRead) {
if (!ser_action.ForRead()) {
uint64_t nVal = CompressAmount(txout.nValue);
READWRITE(VARINT(nVal));
} else {