|
|
@ -34,10 +34,8 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
READWRITE(FLATDATA(*this)); |
|
|
|
READWRITE(FLATDATA(*this)); |
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SetNull() { hash = 0; n = (uint32_t) -1; } |
|
|
|
void SetNull() { hash = 0; n = (uint32_t) -1; } |
|
|
@ -96,12 +94,10 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
READWRITE(prevout); |
|
|
|
READWRITE(prevout); |
|
|
|
READWRITE(scriptSig); |
|
|
|
READWRITE(scriptSig); |
|
|
|
READWRITE(nSequence); |
|
|
|
READWRITE(nSequence); |
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool IsFinal() const |
|
|
|
bool IsFinal() const |
|
|
@ -152,10 +148,8 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
READWRITE(nSatoshisPerK); |
|
|
|
READWRITE(nSatoshisPerK); |
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -179,11 +173,9 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
READWRITE(nValue); |
|
|
|
READWRITE(nValue); |
|
|
|
READWRITE(scriptPubKey); |
|
|
|
READWRITE(scriptPubKey); |
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SetNull() |
|
|
|
void SetNull() |
|
|
@ -264,9 +256,8 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
bool fRead = ser_action.ForRead(); |
|
|
|
bool fRead = boost::is_same<Operation, CSerActionUnserialize>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
READWRITE(*const_cast<int32_t*>(&this->nVersion)); |
|
|
|
READWRITE(*const_cast<int32_t*>(&this->nVersion)); |
|
|
|
nVersion = this->nVersion; |
|
|
|
nVersion = this->nVersion; |
|
|
@ -275,8 +266,6 @@ public: |
|
|
|
READWRITE(*const_cast<uint32_t*>(&nLockTime)); |
|
|
|
READWRITE(*const_cast<uint32_t*>(&nLockTime)); |
|
|
|
if (fRead) |
|
|
|
if (fRead) |
|
|
|
UpdateHash(); |
|
|
|
UpdateHash(); |
|
|
|
|
|
|
|
|
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool IsNull() const { |
|
|
|
bool IsNull() const { |
|
|
@ -327,16 +316,12 @@ struct CMutableTransaction |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
READWRITE(this->nVersion); |
|
|
|
READWRITE(this->nVersion); |
|
|
|
nVersion = this->nVersion; |
|
|
|
nVersion = this->nVersion; |
|
|
|
READWRITE(vin); |
|
|
|
READWRITE(vin); |
|
|
|
READWRITE(vout); |
|
|
|
READWRITE(vout); |
|
|
|
READWRITE(nLockTime); |
|
|
|
READWRITE(nLockTime); |
|
|
|
|
|
|
|
|
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Compute the hash of this CMutableTransaction. This is computed on the
|
|
|
|
/** Compute the hash of this CMutableTransaction. This is computed on the
|
|
|
@ -360,9 +345,8 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
bool fRead = boost::is_same<Operation, CSerActionUnserialize>(); |
|
|
|
bool fRead = ser_action.ForRead(); |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
if (!fRead) { |
|
|
|
if (!fRead) { |
|
|
|
uint64_t nVal = CompressAmount(txout.nValue); |
|
|
|
uint64_t nVal = CompressAmount(txout.nValue); |
|
|
|
READWRITE(VARINT(nVal)); |
|
|
|
READWRITE(VARINT(nVal)); |
|
|
@ -373,7 +357,6 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
CScriptCompressor cscript(REF(txout.scriptPubKey)); |
|
|
|
CScriptCompressor cscript(REF(txout.scriptPubKey)); |
|
|
|
READWRITE(cscript); |
|
|
|
READWRITE(cscript); |
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -430,10 +413,8 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
READWRITE(vprevout); |
|
|
|
READWRITE(vprevout); |
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -465,9 +446,7 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
READWRITE(this->nVersion); |
|
|
|
READWRITE(this->nVersion); |
|
|
|
nVersion = this->nVersion; |
|
|
|
nVersion = this->nVersion; |
|
|
|
READWRITE(hashPrevBlock); |
|
|
|
READWRITE(hashPrevBlock); |
|
|
@ -475,8 +454,6 @@ public: |
|
|
|
READWRITE(nTime); |
|
|
|
READWRITE(nTime); |
|
|
|
READWRITE(nBits); |
|
|
|
READWRITE(nBits); |
|
|
|
READWRITE(nNonce); |
|
|
|
READWRITE(nNonce); |
|
|
|
|
|
|
|
|
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SetNull() |
|
|
|
void SetNull() |
|
|
@ -526,13 +503,9 @@ public: |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
READWRITE(*(CBlockHeader*)this); |
|
|
|
READWRITE(*(CBlockHeader*)this); |
|
|
|
READWRITE(vtx); |
|
|
|
READWRITE(vtx); |
|
|
|
|
|
|
|
|
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SetNull() |
|
|
|
void SetNull() |
|
|
@ -580,14 +553,10 @@ struct CBlockLocator |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
IMPLEMENT_SERIALIZE; |
|
|
|
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation> |
|
|
|
template <typename Stream, typename Operation> |
|
|
|
inline size_t SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { |
|
|
|
size_t nSerSize = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(nType & SER_GETHASH)) |
|
|
|
if (!(nType & SER_GETHASH)) |
|
|
|
READWRITE(nVersion); |
|
|
|
READWRITE(nVersion); |
|
|
|
READWRITE(vHave); |
|
|
|
READWRITE(vHave); |
|
|
|
|
|
|
|
|
|
|
|
return nSerSize; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SetNull() |
|
|
|
void SetNull() |
|
|
|