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/validation.cpp | |
parent | 102294898d708b7adc0150aba8e500a4aa19bc1c (diff) | |
download | bitcoin-a789f3f2b878e1236f8e043a8bb1ffb1afc1b673.tar.xz |
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/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index a54ec8269e..5fdf0398df 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5095,14 +5095,14 @@ bool ChainstateManager::PopulateAndValidateSnapshot( assert(coins_cache.GetBestBlock() == base_blockhash); - CCoinsStats stats{CoinStatsHashType::HASH_SERIALIZED}; + CCoinsStats stats{}; auto breakpoint_fnc = [] { /* TODO insert breakpoint here? */ }; // As above, okay to immediately release cs_main here since no other context knows // about the snapshot_chainstate. CCoinsViewDB* snapshot_coinsdb = WITH_LOCK(::cs_main, return &snapshot_chainstate.CoinsDB()); - if (!GetUTXOStats(snapshot_coinsdb, m_blockman, stats, breakpoint_fnc)) { + if (!GetUTXOStats(snapshot_coinsdb, m_blockman, stats, CoinStatsHashType::HASH_SERIALIZED, breakpoint_fnc)) { LogPrintf("[snapshot] failed to generate coins stats\n"); return false; } |