| 4547 | } |
| 4548 | |
| 4549 | bool ChainstateManager::LoadBlockIndex() |
| 4550 | { |
| 4551 | AssertLockHeld(cs_main); |
| 4552 | // Load block index from databases |
| 4553 | bool needs_init = fReindex; |
| 4554 | if (!fReindex) { |
| 4555 | bool ret = m_blockman.LoadBlockIndexDB(*this); |
| 4556 | if (!ret) return false; |
| 4557 | needs_init = m_blockman.m_block_index.empty(); |
| 4558 | } |
| 4559 | |
| 4560 | if (needs_init) { |
| 4561 | // Everything here is for *new* reindex/DBs. Thus, though |
| 4562 | // LoadBlockIndexDB may have set fReindex if we shut down |
| 4563 | // mid-reindex previously, we don't check fReindex and |
| 4564 | // instead only check it prior to LoadBlockIndexDB to set |
| 4565 | // needs_init. |
| 4566 | |
| 4567 | LogPrintf("Initializing databases...\n"); |
| 4568 | } |
| 4569 | return true; |
| 4570 | } |
| 4571 | |
| 4572 | bool CChainState::LoadGenesisBlock() |
| 4573 | { |
nothing calls this directly
no test coverage detected