diff options
author | Carl Dong <contact@carldong.me> | 2022-02-13 19:27:36 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-05-20 16:33:24 -0400 |
commit | a789f3f2b878e1236f8e043a8bb1ffb1afc1b673 (patch) | |
tree | fe1d822cb8ea6b54d520ad06cb55850e6c5d8ce3 /src/node/coinstats.h | |
parent | 102294898d708b7adc0150aba8e500a4aa19bc1c (diff) |
coinstats: Extract hash_type in-member to in-param
Currently, CCoinsStats is a struct with both in-params and out-params
where the hash_type and index_requested members are the only in-params.
This change removes CCoinsStats' hash_type in-param member and adds it
to the relevant functions instead.
[META] In subsequent commits, all of CCoinsStats' members which serve as
in-params will be moved out so as to make CCoinsStats a pure
out-param struct.
Diffstat (limited to 'src/node/coinstats.h')
-rw-r--r-- | src/node/coinstats.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/node/coinstats.h b/src/node/coinstats.h index aa771b18b0..ee3f3b0030 100644 --- a/src/node/coinstats.h +++ b/src/node/coinstats.h @@ -28,9 +28,6 @@ enum class CoinStatsHashType { }; struct CCoinsStats { - //! Which hash type to use - const CoinStatsHashType m_hash_type; - int nHeight{0}; uint256 hashBlock{}; uint64_t nTransactions{0}; @@ -69,12 +66,10 @@ struct CCoinsStats { CAmount total_unspendables_scripts{0}; //! Total cumulative amount of coins lost due to unclaimed miner rewards up to and including this block CAmount total_unspendables_unclaimed_rewards{0}; - - CCoinsStats(CoinStatsHashType hash_type) : m_hash_type(hash_type) {} }; //! Calculate statistics about the unspent transaction output set -bool GetUTXOStats(CCoinsView* view, node::BlockManager& blockman, CCoinsStats& stats, const std::function<void()>& interruption_point = {}, const CBlockIndex* pindex = nullptr); +bool GetUTXOStats(CCoinsView* view, node::BlockManager& blockman, CCoinsStats& stats, CoinStatsHashType hash_type, const std::function<void()>& interruption_point = {}, const CBlockIndex* pindex = nullptr); uint64_t GetBogoSize(const CScript& script_pub_key); |