Merge pull request #4346

1569353 Add `-stopafterblockimport` option (Wladimir J. van der Laan)
pull/4149/merge
Wladimir J. van der Laan 11 years ago
commit 5694d10781
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

@ -274,6 +274,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += " -dropmessagestest=<n> " + _("Randomly drop 1 of every <n> network messages") + "\n"; strUsage += " -dropmessagestest=<n> " + _("Randomly drop 1 of every <n> network messages") + "\n";
strUsage += " -fuzzmessagestest=<n> " + _("Randomly fuzz 1 of every <n> network messages") + "\n"; strUsage += " -fuzzmessagestest=<n> " + _("Randomly fuzz 1 of every <n> network messages") + "\n";
strUsage += " -flushwallet " + _("Run a thread to flush wallet periodically (default: 1)") + "\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=<category> " + _("Output debugging information (default: 0, supplying <category> is optional)") + "\n"; strUsage += " -debug=<category> " + _("Output debugging information (default: 0, supplying <category> is optional)") + "\n";
strUsage += " " + _("If <category> is not supplied, output all debugging information.") + "\n"; strUsage += " " + _("If <category> is not supplied, output all debugging information.") + "\n";
@ -405,6 +406,11 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
LogPrintf("Warning: Could not open blocks file %s\n", path.string()); LogPrintf("Warning: Could not open blocks file %s\n", path.string());
} }
} }
if (GetBoolArg("-stopafterblockimport", false)) {
LogPrintf("Stopping after block import\n");
StartShutdown();
}
} }
/** Sanity checks /** Sanity checks

Loading…
Cancel
Save