6
6
#ifndef BITCOIN_NODE_COINSTATS_H
7
7
#define BITCOIN_NODE_COINSTATS_H
8
8
9
+ #include < kernel/coinstats.h>
10
+
9
11
#include < chain.h>
10
12
#include < coins.h>
11
13
#include < consensus/amount.h>
@@ -21,54 +23,6 @@ class BlockManager;
21
23
} // namespace node
22
24
23
25
namespace node {
24
- enum class CoinStatsHashType {
25
- HASH_SERIALIZED,
26
- MUHASH,
27
- NONE,
28
- };
29
-
30
- struct CCoinsStats {
31
- int nHeight{0 };
32
- uint256 hashBlock{};
33
- uint64_t nTransactions{0 };
34
- uint64_t nTransactionOutputs{0 };
35
- uint64_t nBogoSize{0 };
36
- uint256 hashSerialized{};
37
- uint64_t nDiskSize{0 };
38
- // ! The total amount, or nullopt if an overflow occurred calculating it
39
- std::optional<CAmount> total_amount{0 };
40
-
41
- // ! The number of coins contained.
42
- uint64_t coins_count{0 };
43
-
44
- // ! Signals if the coinstatsindex was used to retrieve the statistics.
45
- bool index_used{false };
46
-
47
- // Following values are only available from coinstats index
48
-
49
- // ! Total cumulative amount of block subsidies up to and including this block
50
- CAmount total_subsidy{0 };
51
- // ! Total cumulative amount of unspendable coins up to and including this block
52
- CAmount total_unspendable_amount{0 };
53
- // ! Total cumulative amount of prevouts spent up to and including this block
54
- CAmount total_prevout_spent_amount{0 };
55
- // ! Total cumulative amount of outputs created up to and including this block
56
- CAmount total_new_outputs_ex_coinbase_amount{0 };
57
- // ! Total cumulative amount of coinbase outputs up to and including this block
58
- CAmount total_coinbase_amount{0 };
59
- // ! The unspendable coinbase amount from the genesis block
60
- CAmount total_unspendables_genesis_block{0 };
61
- // ! The two unspendable coinbase outputs total amount caused by BIP30
62
- CAmount total_unspendables_bip30{0 };
63
- // ! Total cumulative amount of outputs sent to unspendable scripts (OP_RETURN for example) up to and including this block
64
- CAmount total_unspendables_scripts{0 };
65
- // ! Total cumulative amount of coins lost due to unclaimed miner rewards up to and including this block
66
- CAmount total_unspendables_unclaimed_rewards{0 };
67
-
68
- CCoinsStats () = default ;
69
- CCoinsStats (int block_height, const uint256& block_hash);
70
- };
71
-
72
26
/* *
73
27
* Calculate statistics about the unspent transaction output set
74
28
*
@@ -79,12 +33,6 @@ std::optional<CCoinsStats> GetUTXOStats(CCoinsView* view, node::BlockManager& bl
79
33
const std::function<void ()>& interruption_point = {},
80
34
const CBlockIndex* pindex = nullptr ,
81
35
bool index_requested = true );
82
-
83
- uint64_t GetBogoSize (const CScript& script_pub_key);
84
-
85
- CDataStream TxOutSer (const COutPoint& outpoint, const Coin& coin);
86
-
87
- std::optional<CCoinsStats> ComputeUTXOStats (CoinStatsHashType hash_type, CCoinsView* view, BlockManager& blockman, const std::function<void ()>& interruption_point = {});
88
36
} // namespace node
89
37
90
38
#endif // BITCOIN_NODE_COINSTATS_H
0 commit comments