MCPcopy Create free account
hub / github.com/ElementsProject/elements / LoadBlockIndex

Method LoadBlockIndex

src/validation.cpp:4549–4570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4547}
4548
4549bool 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
4572bool CChainState::LoadGenesisBlock()
4573{

Callers

nothing calls this directly

Calls 2

LoadBlockIndexDBMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected