aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-09-23 13:54:21 -0400
committerJames O'Beirne <james.obeirne@pm.me>2023-09-30 06:38:47 -0400
commit4d8f4dcb450d31e4847804e62bf91545b949fa14 (patch)
tree969db62e4210a1fdf9eeceeb39e4c2755cad051d /src/index
parent1e59acdf17309f567c370885f0cf02605e2baa58 (diff)
downloadbitcoin-4d8f4dcb450d31e4847804e62bf91545b949fa14.tar.xz
validation: pass ChainstateRole for validationinterface calls
This allows consumers to decide how to handle events from background or assumedvalid chainstates.
Diffstat (limited to 'src/index')
-rw-r--r--src/index/base.cpp4
-rw-r--r--src/index/base.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp
index f18205a76f..98a8bad102 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -250,7 +250,7 @@ bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_ti
return true;
}
-void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex)
+void BaseIndex::BlockConnected(ChainstateRole role, const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex)
{
if (!m_synced) {
return;
@@ -296,7 +296,7 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const
}
}
-void BaseIndex::ChainStateFlushed(const CBlockLocator& locator)
+void BaseIndex::ChainStateFlushed(ChainstateRole role, const CBlockLocator& locator)
{
if (!m_synced) {
return;
diff --git a/src/index/base.h b/src/index/base.h
index 9b2a41dc92..b93103eb36 100644
--- a/src/index/base.h
+++ b/src/index/base.h
@@ -102,9 +102,9 @@ protected:
Chainstate* m_chainstate{nullptr};
const std::string m_name;
- void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex) override;
+ void BlockConnected(ChainstateRole role, const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex) override;
- void ChainStateFlushed(const CBlockLocator& locator) override;
+ 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; }