validation: pass ChainstateRole for validationinterface calls

This allows consumers to decide how to handle events from background or
assumedvalid chainstates.
This commit is contained in:
James O'Beirne
2019-09-23 13:54:21 -04:00
committed by James O'Beirne
parent 1e59acdf17
commit 4d8f4dcb45
19 changed files with 66 additions and 42 deletions

View File

@@ -434,9 +434,9 @@ public:
{
m_notifications->transactionRemovedFromMempool(tx, reason);
}
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
void BlockConnected(ChainstateRole role, const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
{
m_notifications->blockConnected(kernel::MakeBlockInfo(index, block.get()));
m_notifications->blockConnected(role, kernel::MakeBlockInfo(index, block.get()));
}
void BlockDisconnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
{
@@ -446,7 +446,9 @@ public:
{
m_notifications->updatedBlockTip();
}
void ChainStateFlushed(const CBlockLocator& locator) override { m_notifications->chainStateFlushed(locator); }
void ChainStateFlushed(ChainstateRole role, const CBlockLocator& locator) override {
m_notifications->chainStateFlushed(role, locator);
}
std::shared_ptr<Chain::Notifications> m_notifications;
};