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.
This commit is contained in:
Carl Dong
2022-02-13 19:27:36 -05:00
parent 102294898d
commit a789f3f2b8
5 changed files with 19 additions and 24 deletions

View File

@@ -33,7 +33,7 @@ BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
{
CoinStatsIndex coin_stats_index{1 << 20, true};
CCoinsStats coin_stats{CoinStatsHashType::MUHASH};
CCoinsStats coin_stats{};
const CBlockIndex* block_index;
{
LOCK(cs_main);
@@ -69,7 +69,7 @@ BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
// Let the CoinStatsIndex to catch up again.
BOOST_CHECK(coin_stats_index.BlockUntilSyncedToCurrentChain());
CCoinsStats new_coin_stats{CoinStatsHashType::MUHASH};
CCoinsStats new_coin_stats{};
const CBlockIndex* new_block_index;
{
LOCK(cs_main);