Changeset View
Changeset View
Standalone View
Standalone View
src/txdb.cpp
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | bool CBlockTreeDB::LoadBlockIndexGuts( | ||||
std::function<CBlockIndex *(const BlockHash &)> insertBlockIndex) { | std::function<CBlockIndex *(const BlockHash &)> insertBlockIndex) { | ||||
std::unique_ptr<CDBIterator> pcursor(NewIterator()); | std::unique_ptr<CDBIterator> pcursor(NewIterator()); | ||||
pcursor->Seek(std::make_pair(DB_BLOCK_INDEX, uint256())); | pcursor->Seek(std::make_pair(DB_BLOCK_INDEX, uint256())); | ||||
// Load mapBlockIndex | // Load mapBlockIndex | ||||
while (pcursor->Valid()) { | while (pcursor->Valid()) { | ||||
boost::this_thread::interruption_point(); | boost::this_thread::interruption_point(); | ||||
if (ShutdownRequested()) { | |||||
return false; | |||||
} | |||||
std::pair<char, uint256> key; | std::pair<char, uint256> key; | ||||
if (!pcursor->GetKey(key) || key.first != DB_BLOCK_INDEX) { | if (!pcursor->GetKey(key) || key.first != DB_BLOCK_INDEX) { | ||||
break; | break; | ||||
} | } | ||||
CDiskBlockIndex diskindex; | CDiskBlockIndex diskindex; | ||||
if (!pcursor->GetValue(diskindex)) { | if (!pcursor->GetValue(diskindex)) { | ||||
return error("%s : failed to read value", __func__); | return error("%s : failed to read value", __func__); | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |