aboutsummaryrefslogtreecommitdiff
path: root/src/index/base.h
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-04-18 23:06:18 +0200
committerFabian Jahr <fjahr@protonmail.com>2022-04-25 23:22:00 +0200
commitf08c9fb0c6a799e3cb75ca5f763a746471625beb (patch)
treecf2cb7bbf15a69cf52bc997ac26305adf3907227 /src/index/base.h
parent2561823531c25e1510c107eb41de944b00444ce0 (diff)
downloadbitcoin-f08c9fb0c6a799e3cb75ca5f763a746471625beb.tar.xz
Index: Use prune locks for blockfilterindex
Prior to this change blocks could be pruned up to the last block before the blockfilterindex current best block.
Diffstat (limited to 'src/index/base.h')
-rw-r--r--src/index/base.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/index/base.h b/src/index/base.h
index c4a8215bc4..a8f6a18c8d 100644
--- a/src/index/base.h
+++ b/src/index/base.h
@@ -75,6 +75,9 @@ private:
/// to a chain reorganization), the index must halt until Commit succeeds or else it could end up
/// getting corrupted.
bool Commit();
+
+ virtual bool AllowPrune() const = 0;
+
protected:
CChainState* m_chainstate{nullptr};
@@ -103,6 +106,9 @@ protected:
/// Get the name of the index for display in logs.
virtual const char* GetName() const = 0;
+ /// Update the internal best block index as well as the prune lock.
+ void SetBestBlockIndex(const CBlockIndex* block);
+
public:
/// Destructor interrupts sync thread if running and blocks until it exits.
virtual ~BaseIndex();