diff options
Diffstat (limited to 'src/index/base.h')
-rw-r--r-- | src/index/base.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/index/base.h b/src/index/base.h index 14693bc6fe..349178a535 100644 --- a/src/index/base.h +++ b/src/index/base.h @@ -10,6 +10,8 @@ #include <threadinterrupt.h> #include <validationinterface.h> +#include <string> + class CBlock; class CBlockIndex; class Chainstate; @@ -95,6 +97,7 @@ private: protected: std::unique_ptr<interfaces::Chain> m_chain; Chainstate* m_chainstate{nullptr}; + const std::string m_name; void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex) override; @@ -117,13 +120,13 @@ protected: virtual DB& GetDB() const = 0; /// Get the name of the index for display in logs. - virtual const char* GetName() const = 0; + const std::string& GetName() const LIFETIMEBOUND { return m_name; } /// Update the internal best block index as well as the prune lock. void SetBestBlockIndex(const CBlockIndex* block); public: - BaseIndex(std::unique_ptr<interfaces::Chain> chain); + BaseIndex(std::unique_ptr<interfaces::Chain> chain, std::string name); /// Destructor interrupts sync thread if running and blocks until it exits. virtual ~BaseIndex(); |