diff options
author | stickies-v <stickies-v@protonmail.com> | 2022-08-31 16:43:58 +0100 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2022-09-13 19:10:41 +0100 |
commit | 200d84d5681918523d982b9ddf60d1127edcb448 (patch) | |
tree | 2e48f3415525967d344c6ab097a0aa78a4594279 /src/index/base.h | |
parent | 97f5b20c12ca6ccf89d7720a5d41eaf4cda1b695 (diff) | |
download | bitcoin-200d84d5681918523d982b9ddf60d1127edcb448.tar.xz |
refactor: use std::string for index names
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(); |