diff options
Diffstat (limited to 'src/index/coinstatsindex.h')
-rw-r--r-- | src/index/coinstatsindex.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/index/coinstatsindex.h b/src/index/coinstatsindex.h index c4af223388..21ce4c4767 100644 --- a/src/index/coinstatsindex.h +++ b/src/index/coinstatsindex.h @@ -1,15 +1,20 @@ -// Copyright (c) 2020-2021 The Bitcoin Core developers +// Copyright (c) 2020-2022 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_INDEX_COINSTATSINDEX_H #define BITCOIN_INDEX_COINSTATSINDEX_H -#include <chain.h> #include <crypto/muhash.h> -#include <flatfile.h> #include <index/base.h> -#include <kernel/coinstats.h> + +class CBlockIndex; +class CDBBatch; +namespace kernel { +struct CCoinsStats; +} + +static constexpr bool DEFAULT_COINSTATSINDEX{false}; /** * CoinStatsIndex maintains statistics on the UTXO set. @@ -17,7 +22,6 @@ class CoinStatsIndex final : public BaseIndex { private: - std::string m_name; std::unique_ptr<BaseIndex::DB> m_db; MuHash3072 m_muhash; @@ -49,14 +53,12 @@ protected: BaseIndex::DB& GetDB() const override { return *m_db; } - const char* GetName() const override { return "coinstatsindex"; } - public: // Constructs the index, which becomes available to be queried. explicit CoinStatsIndex(std::unique_ptr<interfaces::Chain> chain, size_t n_cache_size, bool f_memory = false, bool f_wipe = false); // Look up stats for a specific block using CBlockIndex - std::optional<kernel::CCoinsStats> LookUpStats(const CBlockIndex* block_index) const; + std::optional<kernel::CCoinsStats> LookUpStats(const CBlockIndex& block_index) const; }; /// The global UTXO set hash object. |