diff options
Diffstat (limited to 'src/index/base.h')
-rw-r--r-- | src/index/base.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/index/base.h b/src/index/base.h index 0eb1d9ca3b..fbd9069a51 100644 --- a/src/index/base.h +++ b/src/index/base.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2022 The Bitcoin Core developers +// Copyright (c) 2017-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -7,6 +7,8 @@ #include <dbwrapper.h> #include <interfaces/chain.h> +#include <interfaces/types.h> +#include <util/string.h> #include <util/threadinterrupt.h> #include <validationinterface.h> @@ -94,7 +96,7 @@ private: virtual bool AllowPrune() const = 0; template <typename... Args> - void FatalErrorf(const char* fmt, const Args&... args); + void FatalErrorf(util::ConstevalFormatString<sizeof...(Args)> fmt, const Args&... args); protected: std::unique_ptr<interfaces::Chain> m_chain; @@ -106,7 +108,7 @@ protected: void ChainStateFlushed(ChainstateRole role, const CBlockLocator& locator) override; /// Initialize internal state from the database and block index. - [[nodiscard]] virtual bool CustomInit(const std::optional<interfaces::BlockKey>& block) { return true; } + [[nodiscard]] virtual bool CustomInit(const std::optional<interfaces::BlockRef>& block) { return true; } /// Write update index entries for a newly connected block. [[nodiscard]] virtual bool CustomAppend(const interfaces::BlockInfo& block) { return true; } @@ -117,7 +119,7 @@ protected: /// Rewind index to an earlier chain tip during a chain reorg. The tip must /// be an ancestor of the current best block. - [[nodiscard]] virtual bool CustomRewind(const interfaces::BlockKey& current_tip, const interfaces::BlockKey& new_tip) { return true; } + [[nodiscard]] virtual bool CustomRewind(const interfaces::BlockRef& current_tip, const interfaces::BlockRef& new_tip) { return true; } virtual DB& GetDB() const = 0; |