refactor: Convert ChainstateRole enum to struct

Change ChainstateRole parameter passed to wallets and indexes. Wallets and
indexes need to know whether chainstate is historical and whether it is fully
validated. They should not be aware of the assumeutxo snapshot validation
process.
This commit is contained in:
Ryan Ofsky
2025-06-18 09:51:34 -04:00
parent 352ad27fc1
commit 4dfe383912
26 changed files with 130 additions and 79 deletions

View File

@@ -81,6 +81,7 @@ using interfaces::MakeSignalHandler;
using interfaces::Mining;
using interfaces::Node;
using interfaces::WalletLoader;
using kernel::ChainstateRole;
using node::BlockAssembler;
using node::BlockWaitOptions;
using util::Join;
@@ -461,7 +462,7 @@ public:
{
m_notifications->transactionRemovedFromMempool(tx, reason);
}
void BlockConnected(ChainstateRole role, const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
void BlockConnected(const ChainstateRole& role, const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
{
m_notifications->blockConnected(role, kernel::MakeBlockInfo(index, block.get()));
}
@@ -473,7 +474,8 @@ public:
{
m_notifications->updatedBlockTip();
}
void ChainStateFlushed(ChainstateRole role, const CBlockLocator& locator) override {
void ChainStateFlushed(const ChainstateRole& role, const CBlockLocator& locator) override
{
m_notifications->chainStateFlushed(role, locator);
}
std::shared_ptr<Chain::Notifications> m_notifications;