Bitcoin ABC  0.24.7
P2P Digital Currency
coinstats.h
Go to the documentation of this file.
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 <primitives/blockhash.h>
11 #include <uint256.h>
12 
13 #include <cstdint>
14 #include <functional>
15 
16 class CCoinsView;
17 
18 enum class CoinStatsHashType {
20  NONE,
21 };
22 
23 struct CCoinsStats {
24  int nHeight{0};
26  uint64_t nTransactions{0};
27  uint64_t nTransactionOutputs{0};
28  uint64_t nBogoSize{0};
30  uint64_t nDiskSize{0};
32 
34  uint64_t coins_count{0};
35 };
36 
38 bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats,
39  const CoinStatsHashType hash_type,
40  const std::function<void()> &interruption_point = {});
41 
42 #endif // BITCOIN_NODE_COINSTATS_H
CoinStatsHashType::HASH_SERIALIZED
@ HASH_SERIALIZED
GetUTXOStats
bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats, const CoinStatsHashType hash_type, const std::function< void()> &interruption_point={})
Calculate statistics about the unspent transaction output set.
Definition: coinstats.cpp:97
CCoinsStats::nDiskSize
uint64_t nDiskSize
Definition: coinstats.h:30
uint256.h
CCoinsStats::nTransactions
uint64_t nTransactions
Definition: coinstats.h:26
CCoinsStats
Definition: coinstats.h:23
blockhash.h
CoinStatsHashType::NONE
@ NONE
CCoinsStats::hashBlock
BlockHash hashBlock
Definition: coinstats.h:25
Amount::zero
static constexpr Amount zero()
Definition: amount.h:42
CCoinsView
Abstract view on the open txout dataset.
Definition: coins.h:175
uint256
256-bit opaque blob.
Definition: uint256.h:127
Amount
Definition: amount.h:19
CCoinsStats::coins_count
uint64_t coins_count
The number of coins contained.
Definition: coinstats.h:34
BlockHash
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
CCoinsStats::nHeight
int nHeight
Definition: coinstats.h:24
CCoinsStats::nTransactionOutputs
uint64_t nTransactionOutputs
Definition: coinstats.h:27
CCoinsStats::nBogoSize
uint64_t nBogoSize
Definition: coinstats.h:28
CCoinsStats::nTotalAmount
Amount nTotalAmount
Definition: coinstats.h:31
CCoinsStats::hashSerialized
uint256 hashSerialized
Definition: coinstats.h:29
CoinStatsHashType
CoinStatsHashType
Definition: coinstats.h:18
amount.h