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

Method Init

src/index/blockfilterindex.cpp:111–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111bool BlockFilterIndex::Init()
112{
113 if (!m_db->Read(DB_FILTER_POS, m_next_filter_pos)) {
114 // Check that the cause of the read failure is that the key does not exist. Any other errors
115 // indicate database corruption or a disk failure, and starting the index would cause
116 // further corruption.
117 if (m_db->Exists(DB_FILTER_POS)) {
118 return error("%s: Cannot read current %s state; index may be corrupted",
119 __func__, GetName());
120 }
121
122 // If the DB_FILTER_POS is not set, then initialize to the first location.
123 m_next_filter_pos.nFile = 0;
124 m_next_filter_pos.nPos = 0;
125 }
126 return BaseIndex::Init();
127}
128
129bool BlockFilterIndex::CommitInternal(CDBBatch& batch)
130{

Callers

nothing calls this directly

Calls 4

errorFunction · 0.85
InitClass · 0.50
ReadMethod · 0.45
ExistsMethod · 0.45

Tested by

no test coverage detected