Line data Source code
1 : // Copyright (c) 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_COINSTATS_H 7 : #define BITCOIN_NODE_COINSTATS_H 8 : 9 : #include <amount.h> 10 : #include <uint256.h> 11 : 12 : #include <cstdint> 13 : #include <functional> 14 : 15 : class CCoinsView; 16 : 17 : enum class CoinStatsHashType { 18 : HASH_SERIALIZED, 19 : NONE, 20 : }; 21 : 22 28 : struct CCoinsStats 23 : { 24 14 : int nHeight{0}; 25 14 : uint256 hashBlock{}; 26 14 : uint64_t nTransactions{0}; 27 14 : uint64_t nTransactionOutputs{0}; 28 14 : uint64_t nBogoSize{0}; 29 14 : uint256 hashSerialized{}; 30 14 : uint64_t nDiskSize{0}; 31 14 : CAmount nTotalAmount{0}; 32 : 33 : //! The number of coins contained. 34 14 : uint64_t coins_count{0}; 35 : }; 36 : 37 : //! Calculate statistics about the unspent transaction output set 38 : bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats, const CoinStatsHashType hash_type, const std::function<void()>& interruption_point = {}); 39 : 40 : #endif // BITCOIN_NODE_COINSTATS_H