| 5544 | } |
| 5545 | |
| 5546 | double ChainstateManager::GetBackgroundVerificationProgress(const CBlockIndex& pindex) const |
| 5547 | { |
| 5548 | AssertLockHeld(GetMutex()); |
| 5549 | Assert(HistoricalChainstate()); |
| 5550 | auto target_block = HistoricalChainstate()->TargetBlock(); |
| 5551 | |
| 5552 | if (pindex.m_chain_tx_count == 0 || target_block->m_chain_tx_count == 0) { |
| 5553 | LogDebug(BCLog::VALIDATION, "[background validation] Block %d has unset m_chain_tx_count. Unable to estimate verification progress.", pindex.nHeight); |
| 5554 | return 0.0; |
| 5555 | } |
| 5556 | return static_cast<double>(pindex.m_chain_tx_count) / static_cast<double>(target_block->m_chain_tx_count); |
| 5557 | } |
| 5558 | |
| 5559 | Chainstate& ChainstateManager::InitializeChainstate(CTxMemPool* mempool) |
| 5560 | { |
no test coverage detected