From 89576ccc572fcaf9fb7117ad6124482cc95fbd9f Mon Sep 17 00:00:00 2001 From: stickies-v Date: Wed, 31 Aug 2022 14:34:53 +0100 Subject: refactor: add LIFETIMEBOUND to blockfilter where needed Ensure that the return values do not have a lifetime that exceeds the lifetime of what it is bound to. See https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#lifetimebound --- src/index/blockfilterindex.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/index') diff --git a/src/index/blockfilterindex.h b/src/index/blockfilterindex.h index 968eccb6b3..a31f7e460e 100644 --- a/src/index/blockfilterindex.h +++ b/src/index/blockfilterindex.h @@ -5,6 +5,7 @@ #ifndef BITCOIN_INDEX_BLOCKFILTERINDEX_H #define BITCOIN_INDEX_BLOCKFILTERINDEX_H +#include #include #include #include @@ -49,9 +50,9 @@ protected: bool CustomRewind(const interfaces::BlockKey& current_tip, const interfaces::BlockKey& new_tip) override; - BaseIndex::DB& GetDB() const override { return *m_db; } + BaseIndex::DB& GetDB() const LIFETIMEBOUND override { return *m_db; } - const char* GetName() const override { return m_name.c_str(); } + const char* GetName() const LIFETIMEBOUND override { return m_name.c_str(); } public: /** Constructs the index, which becomes available to be queried. */ -- cgit v1.2.3