Bitcoin Core  21.99.0
P2P Digital Currency
coinstats.h
Go to the documentation of this file.
1 // Copyright (c) 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_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 BlockManager;
16 class CCoinsView;
17 
18 enum class CoinStatsHashType {
20  MUHASH,
21  NONE,
22 };
23 
25 {
26  int nHeight{0};
28  uint64_t nTransactions{0};
29  uint64_t nTransactionOutputs{0};
30  uint64_t nBogoSize{0};
32  uint64_t nDiskSize{0};
34 
36  uint64_t coins_count{0};
37 };
38 
40 bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats& stats, const CoinStatsHashType hash_type, const std::function<void()>& interruption_point = {});
41 
42 #endif // BITCOIN_NODE_COINSTATS_H
CoinStatsHashType::HASH_SERIALIZED
@ HASH_SERIALIZED
CCoinsStats::nDiskSize
uint64_t nDiskSize
Definition: coinstats.h:32
uint256.h
CCoinsStats::nTransactions
uint64_t nTransactions
Definition: coinstats.h:28
CCoinsStats
Definition: coinstats.h:24
BlockManager
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-w...
Definition: validation.h:364
CoinStatsHashType::NONE
@ NONE
CCoinsView
Abstract view on the open txout dataset.
Definition: coins.h:159
CCoinsStats::hashBlock
uint256 hashBlock
Definition: coinstats.h:27
CAmount
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
CoinStatsHashType::MUHASH
@ MUHASH
uint256
256-bit opaque blob.
Definition: uint256.h:124
CCoinsStats::coins_count
uint64_t coins_count
The number of coins contained.
Definition: coinstats.h:36
CCoinsStats::nHeight
int nHeight
Definition: coinstats.h:26
CCoinsStats::nTransactionOutputs
uint64_t nTransactionOutputs
Definition: coinstats.h:29
CCoinsStats::nBogoSize
uint64_t nBogoSize
Definition: coinstats.h:30
CCoinsStats::nTotalAmount
CAmount nTotalAmount
Definition: coinstats.h:33
CCoinsStats::hashSerialized
uint256 hashSerialized
Definition: coinstats.h:31
GetUTXOStats
bool GetUTXOStats(CCoinsView *view, BlockManager &blockman, CCoinsStats &stats, const CoinStatsHashType hash_type, const std::function< void()> &interruption_point={})
Calculate statistics about the unspent transaction output set.
Definition: coinstats.cpp:132
CoinStatsHashType
CoinStatsHashType
Definition: coinstats.h:18
amount.h