aboutsummaryrefslogtreecommitdiff
path: root/src/node/coinstats.h
blob: fbd5fd40679c226c268d2c57343f732464f7f97d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_NODE_COINSTATS_H
#define BITCOIN_NODE_COINSTATS_H

#include <kernel/coinstats.h>

#include <chain.h>
#include <coins.h>
#include <consensus/amount.h>
#include <streams.h>
#include <uint256.h>

#include <cstdint>
#include <functional>

class CCoinsView;
namespace node {
class BlockManager;
} // namespace node

namespace node {
/**
 * Calculate statistics about the unspent transaction output set
 *
 * @param[in] index_requested Signals if the coinstatsindex should be used (when available).
 */
std::optional<CCoinsStats> GetUTXOStats(CCoinsView* view, node::BlockManager& blockman,
                                        CoinStatsHashType hash_type,
                                        const std::function<void()>& interruption_point = {},
                                        const CBlockIndex* pindex = nullptr,
                                        bool index_requested = true);
} // namespace node

#endif // BITCOIN_NODE_COINSTATS_H