Bitcoin Core  0.20.99
P2P Digital Currency
disktxpos.h
Go to the documentation of this file.
1 // Copyright (c) 2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_INDEX_DISKTXPOS_H
6 #define BITCOIN_INDEX_DISKTXPOS_H
7 
8 #include <flatfile.h>
9 #include <serialize.h>
10 
11 struct CDiskTxPos : public FlatFilePos
12 {
13  unsigned int nTxOffset; // after header
14 
16  {
18  READWRITE(VARINT(obj.nTxOffset));
19  }
20 
21  CDiskTxPos(const FlatFilePos &blockIn, unsigned int nTxOffsetIn) : FlatFilePos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
22  }
23 
25  SetNull();
26  }
27 
28  void SetNull() {
30  nTxOffset = 0;
31  }
32 };
33 
34 
35 #endif // BITCOIN_INDEX_DISKTXPOS_H
#define VARINT(obj)
Definition: serialize.h:479
unsigned int nTxOffset
Definition: disktxpos.h:13
int nFile
Definition: flatfile.h:16
#define READWRITEAS(type, obj)
Definition: serialize.h:176
CDiskTxPos(const FlatFilePos &blockIn, unsigned int nTxOffsetIn)
Definition: disktxpos.h:21
void SetNull()
Definition: flatfile.h:36
void SetNull()
Definition: disktxpos.h:28
#define READWRITE(...)
Definition: serialize.h:175
CDiskTxPos()
Definition: disktxpos.h:24
unsigned int nPos
Definition: flatfile.h:17
SERIALIZE_METHODS(CDiskTxPos, obj)
Definition: disktxpos.h:15