From d6d8a78f26f52fdfe43293686135e2fc6919926c Mon Sep 17 00:00:00 2001 From: Jim Posen Date: Sun, 6 Jan 2019 11:43:38 -0800 Subject: Move CDiskBlockPos from chain to flatfile. --- src/chain.h | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'src/chain.h') diff --git a/src/chain.h b/src/chain.h index 5a6f10b84f..583c46c58c 100644 --- a/src/chain.h +++ b/src/chain.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -90,46 +91,6 @@ public: } }; -struct CDiskBlockPos -{ - int nFile; - unsigned int nPos; - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action) { - READWRITE(VARINT(nFile, VarIntMode::NONNEGATIVE_SIGNED)); - READWRITE(VARINT(nPos)); - } - - CDiskBlockPos() { - SetNull(); - } - - CDiskBlockPos(int nFileIn, unsigned int nPosIn) { - nFile = nFileIn; - nPos = nPosIn; - } - - friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) { - return (a.nFile == b.nFile && a.nPos == b.nPos); - } - - friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) { - return !(a == b); - } - - void SetNull() { nFile = -1; nPos = 0; } - bool IsNull() const { return (nFile == -1); } - - std::string ToString() const - { - return strprintf("CDiskBlockPos(nFile=%i, nPos=%i)", nFile, nPos); - } - -}; - enum BlockStatus: uint32_t { //! Unused. BLOCK_VALID_UNKNOWN = 0, -- cgit v1.2.3