mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Some missing non-Dash-specifc serializations
This commit is contained in:
parent
9029448233
commit
64d4a48a09
@ -85,12 +85,9 @@ struct CDiskBlockPos
|
||||
int nFile;
|
||||
unsigned int nPos;
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(VARINT(nFile, VarIntMode::NONNEGATIVE_SIGNED));
|
||||
READWRITE(VARINT(nPos));
|
||||
SERIALIZE_METHODS(CDiskBlockPos, obj)
|
||||
{
|
||||
READWRITE(VARINT(obj.nFile, VarIntMode::NONNEGATIVE_SIGNED), VARINT(obj.nPos));
|
||||
}
|
||||
|
||||
CDiskBlockPos() {
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
OverrideStream<Stream>& operator>>(T& obj)
|
||||
OverrideStream<Stream>& operator>>(T&& obj)
|
||||
{
|
||||
// Unserialize from this stream
|
||||
::Unserialize(*this, obj);
|
||||
|
10
src/txdb.h
10
src/txdb.h
@ -46,12 +46,10 @@ struct CDiskTxPos : public CDiskBlockPos
|
||||
{
|
||||
unsigned int nTxOffset; // after header
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITEAS(CDiskBlockPos, *this);
|
||||
READWRITE(VARINT(nTxOffset));
|
||||
SERIALIZE_METHODS(CDiskTxPos, obj)
|
||||
{
|
||||
READWRITEAS(CDiskBlockPos, obj);
|
||||
READWRITE(VARINT(obj.nTxOffset));
|
||||
}
|
||||
|
||||
CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
|
||||
|
@ -28,7 +28,7 @@ struct TxInUndoFormatter
|
||||
// Required to maintain compatibility with older undo format.
|
||||
::Serialize(s, (unsigned char)0);
|
||||
}
|
||||
::Serialize(s, Using<TxOutCompression>(REF(txout.out)));
|
||||
::Serialize(s, Using<TxOutCompression>(txout.out));
|
||||
}
|
||||
|
||||
template<typename Stream>
|
||||
@ -44,7 +44,7 @@ struct TxInUndoFormatter
|
||||
unsigned int nVersionDummy;
|
||||
::Unserialize(s, VARINT(nVersionDummy));
|
||||
}
|
||||
::Unserialize(s, Using<TxOutCompression>(REF(txout.out)));
|
||||
::Unserialize(s, Using<TxOutCompression>(txout.out));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -236,15 +236,10 @@ public:
|
||||
tx = std::move(arg);
|
||||
}
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
SERIALIZE_METHODS(CMerkleTx, obj)
|
||||
{
|
||||
std::vector<uint256> vMerkleBranch; // For compatibility with older versions.
|
||||
READWRITE(tx);
|
||||
READWRITE(hashBlock);
|
||||
READWRITE(vMerkleBranch);
|
||||
READWRITE(nIndex);
|
||||
READWRITE(obj.tx, obj.hashBlock, vMerkleBranch, obj.nIndex);
|
||||
}
|
||||
|
||||
void SetMerkleBranch(const CBlockIndex* pIndex, int posInBlock);
|
||||
@ -581,17 +576,12 @@ public:
|
||||
|
||||
explicit CWalletKey(int64_t nExpires=0);
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
SERIALIZE_METHODS(CWalletKey, obj)
|
||||
{
|
||||
int nVersion = s.GetVersion();
|
||||
if (!(s.GetType() & SER_GETHASH))
|
||||
READWRITE(nVersion);
|
||||
READWRITE(vchPrivKey);
|
||||
READWRITE(nTimeCreated);
|
||||
READWRITE(nTimeExpires);
|
||||
READWRITE(LIMITED_STRING(strComment, 65536));
|
||||
READWRITE(obj.vchPrivKey, obj.nTimeCreated, obj.nTimeExpires, LIMITED_STRING(obj.strComment, 65536));
|
||||
}
|
||||
};
|
||||
|
||||
@ -1320,14 +1310,12 @@ public:
|
||||
vchPubKey = CPubKey();
|
||||
}
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
SERIALIZE_METHODS(CAccount, obj)
|
||||
{
|
||||
int nVersion = s.GetVersion();
|
||||
if (!(s.GetType() & SER_GETHASH))
|
||||
READWRITE(nVersion);
|
||||
READWRITE(vchPubKey);
|
||||
READWRITE(obj.vchPubKey);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user