From 1569353b8aa535f086833acb6223650972c89790 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 7 May 2014 18:10:48 +0000 Subject: [PATCH] Add `-stopafterblockimport` option Stop after importing blocks. This can be useful for development and trouble shooting. --- src/init.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 39453da9c..0a0b479fa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -273,6 +273,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -dropmessagestest= " + _("Randomly drop 1 of every network messages") + "\n"; strUsage += " -fuzzmessagestest= " + _("Randomly fuzz 1 of every network messages") + "\n"; strUsage += " -flushwallet " + _("Run a thread to flush wallet periodically (default: 1)") + "\n"; + strUsage += " -stopafterblockimport " + _("Stop running after importing blocks from disk (default: 0)") + "\n"; } strUsage += " -debug= " + _("Output debugging information (default: 0, supplying is optional)") + "\n"; strUsage += " " + _("If is not supplied, output all debugging information.") + "\n"; @@ -404,6 +405,11 @@ void ThreadImport(std::vector vImportFiles) LogPrintf("Warning: Could not open blocks file %s\n", path.string()); } } + + if (GetBoolArg("-stopafterblockimport", false)) { + LogPrintf("Stopping after block import\n"); + StartShutdown(); + } } /** Sanity checks