From 871c3557bf08dd29c6d2ffd10e854bbd0478b3b5 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Wed, 18 Apr 2012 12:30:24 +0100 Subject: Added ability to respond to signals during Block Loading stage. --- src/init.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 0eb37fe99c..14db9e7f5e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -353,6 +353,15 @@ bool AppInit2(int argc, char* argv[]) nStart = GetTimeMillis(); if (!LoadBlockIndex()) strErrors << _("Error loading blkindex.dat") << "\n"; + + // as LoadBlockIndex can take several minutes, it's possible the user + // requested to kill bitcoin-qt during the last operation. If so, exit. + // As the program has not fully started yet, Shutdown() is possibly overkill. + if (fRequestShutdown) + { + printf("Shutdown requested. Exiting.\n"); + return false; + } printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart); InitMessage(_("Loading wallet...")); -- cgit v1.2.3