aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorR E Broadley <rebroad+github@gmail.com>2012-04-18 12:30:24 +0100
committerR E Broadley <rebroad+github@gmail.com>2012-04-18 12:30:24 +0100
commit871c3557bf08dd29c6d2ffd10e854bbd0478b3b5 (patch)
tree2bcec5de60e32c895946a1cda2b4440ff8313f86 /src/db.cpp
parentac4161e25df2a9475abb0f62d32a7d86d6baff0f (diff)
Added ability to respond to signals during Block Loading stage.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/db.cpp b/src/db.cpp
index c38070f347..39a41894d7 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -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());