mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
Added ability to respond to signals during Block Loading stage.
This commit is contained in:
@@ -529,7 +529,7 @@ bool CTxDB::LoadBlockIndex()
|
||||
// Unserialize
|
||||
string strType;
|
||||
ssKey >> strType;
|
||||
if (strType == "blockindex")
|
||||
if (strType == "blockindex" && !fRequestShutdown)
|
||||
{
|
||||
CDiskBlockIndex diskindex;
|
||||
ssValue >> diskindex;
|
||||
@@ -556,11 +556,14 @@ bool CTxDB::LoadBlockIndex()
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
break; // if shutdown requested or finished loading block index
|
||||
}
|
||||
}
|
||||
pcursor->close();
|
||||
|
||||
if (fRequestShutdown)
|
||||
return true;
|
||||
|
||||
// Calculate bnChainWork
|
||||
vector<pair<int, CBlockIndex*> > vSortedByHeight;
|
||||
vSortedByHeight.reserve(mapBlockIndex.size());
|
||||
|
||||
Reference in New Issue
Block a user