Bitcoin ABC  0.22.13
P2P Digital Currency
utxo_snapshot.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_NODE_UTXO_SNAPSHOT_H
7 #define BITCOIN_NODE_UTXO_SNAPSHOT_H
8 
9 #include <primitives/blockhash.h>
10 #include <serialize.h>
11 
15 public:
19 
22  uint64_t m_coins_count = 0;
23 
26  uint64_t m_nchaintx = 0;
27 
29  SnapshotMetadata(const BlockHash &base_blockhash, uint64_t coins_count,
30  uint64_t nchaintx)
31  : m_base_blockhash(base_blockhash), m_coins_count(coins_count),
32  m_nchaintx(nchaintx) {}
33 
35 
36  template <typename Stream, typename Operation>
37  inline void SerializationOp(Stream &s, Operation ser_action) {
38  READWRITE(m_base_blockhash);
39  READWRITE(m_coins_count);
40  READWRITE(m_nchaintx);
41  }
42 };
43 
44 #endif // BITCOIN_NODE_UTXO_SNAPSHOT_H
uint64_t m_coins_count
The number of coins in the UTXO set contained in this snapshot.
Definition: utxo_snapshot.h:22
BlockHash m_base_blockhash
The hash of the block that reflects the tip of the chain for the UTXO set contained in this snapshot...
Definition: utxo_snapshot.h:18
Metadata describing a serialized version of a UTXO set from which an assumeutxo CChainState can be co...
Definition: utxo_snapshot.h:14
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
SnapshotMetadata(const BlockHash &base_blockhash, uint64_t coins_count, uint64_t nchaintx)
Definition: utxo_snapshot.h:29
#define READWRITE(...)
Definition: serialize.h:191
uint64_t m_nchaintx
Necessary to "fake" the base nChainTx so that we can estimate progress during initial block download ...
Definition: utxo_snapshot.h:26
void SerializationOp(Stream &s, Operation ser_action)
Definition: utxo_snapshot.h:37