diff options
author | Jim Posen <jim.posen@gmail.com> | 2019-01-06 11:43:38 -0800 |
---|---|---|
committer | Jim Posen <jim.posen@gmail.com> | 2019-02-22 17:38:45 -0800 |
commit | d6d8a78f26f52fdfe43293686135e2fc6919926c (patch) | |
tree | 88e7fdae60dcacd7cede677273556a4c69c4544f /src/chain.h | |
parent | e0380933e3745214331d358bda8c5e79299c84d2 (diff) |
Move CDiskBlockPos from chain to flatfile.
Diffstat (limited to 'src/chain.h')
-rw-r--r-- | src/chain.h | 41 |
1 files changed, 1 insertions, 40 deletions
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 <arith_uint256.h> #include <consensus/params.h> +#include <flatfile.h> #include <primitives/block.h> #include <tinyformat.h> #include <uint256.h> @@ -90,46 +91,6 @@ public: } }; -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)); - } - - 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, |