mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-30 18:35:54 +02:00
validation: add ChainstateRole
This commit is contained in:
@@ -5813,6 +5813,16 @@ bool ChainstateManager::DeleteSnapshotChainstate()
|
||||
return true;
|
||||
}
|
||||
|
||||
ChainstateRole Chainstate::GetRole() const
|
||||
{
|
||||
if (m_chainman.GetAll().size() <= 1) {
|
||||
return ChainstateRole::NORMAL;
|
||||
}
|
||||
return (this != &m_chainman.ActiveChainstate()) ?
|
||||
ChainstateRole::BACKGROUND :
|
||||
ChainstateRole::ASSUMEDVALID;
|
||||
}
|
||||
|
||||
const CBlockIndex* ChainstateManager::GetSnapshotBaseBlock() const
|
||||
{
|
||||
return m_active_chainstate ? m_active_chainstate->SnapshotBase() : nullptr;
|
||||
|
||||
Reference in New Issue
Block a user