Bitcoin Core 28.99.0
P2P Digital Currency
disktxpos.h
Go to the documentation of this file.
1// Copyright (c) 2019-2020 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
11struct CDiskTxPos : public FlatFilePos
12{
13 unsigned int nTxOffset{0}; // after header
14
16 {
17 READWRITE(AsBase<FlatFilePos>(obj), VARINT(obj.nTxOffset));
18 }
19
20 CDiskTxPos(const FlatFilePos &blockIn, unsigned int nTxOffsetIn) : FlatFilePos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
21 }
22
23 CDiskTxPos() = default;
24};
25
26#endif // BITCOIN_INDEX_DISKTXPOS_H
#define VARINT(obj)
Definition: serialize.h:498
#define READWRITE(...)
Definition: serialize.h:156
CDiskTxPos()=default
SERIALIZE_METHODS(CDiskTxPos, obj)
Definition: disktxpos.h:15
CDiskTxPos(const FlatFilePos &blockIn, unsigned int nTxOffsetIn)
Definition: disktxpos.h:20
unsigned int nTxOffset
Definition: disktxpos.h:13
int nFile
Definition: flatfile.h:16
unsigned int nPos
Definition: flatfile.h:17