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