Line data Source code
1 : // Copyright (c) 2009-2010 Satoshi Nakamoto 2 : // Copyright (c) 2009-2021 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 <uint256.h> 10 : #include <serialize.h> 11 : 12 : namespace node { 13 : //! Metadata describing a serialized version of a UTXO set from which an 14 : //! assumeutxo CChainState can be constructed. 15 : class SnapshotMetadata 16 : { 17 : public: 18 : //! The hash of the block that reflects the tip of the chain for the 19 : //! UTXO set contained in this snapshot. 20 : uint256 m_base_blockhash; 21 : 22 : //! The number of coins in the UTXO set contained in this snapshot. Used 23 : //! during snapshot load to estimate progress of UTXO set reconstruction. 24 9 : uint64_t m_coins_count = 0; 25 : 26 27 : SnapshotMetadata() { } 27 18 : SnapshotMetadata( 28 : const uint256& base_blockhash, 29 : uint64_t coins_count, 30 : unsigned int nchaintx) : 31 9 : m_base_blockhash(base_blockhash), 32 18 : m_coins_count(coins_count) { } 33 : 34 54 : SERIALIZE_METHODS(SnapshotMetadata, obj) { READWRITE(obj.m_base_blockhash, obj.m_coins_count); } 35 : }; 36 : } // namespace node 37 : 38 : #endif // BITCOIN_NODE_UTXO_SNAPSHOT_H