aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 323d1cedcf..0f641821d4 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -452,6 +452,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-mempoolreplacement", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT));
strUsage += HelpMessageGroup(_("Block creation options:"));
+ strUsage += HelpMessageOpt("-blockmaxcost=<n>", strprintf(_("Set maximum block cost (default: %d)"), DEFAULT_BLOCK_MAX_COST));
strUsage += HelpMessageOpt("-blockminsize=<n>", strprintf(_("Set minimum block size in bytes (default: %u)"), DEFAULT_BLOCK_MIN_SIZE));
strUsage += HelpMessageOpt("-blockmaxsize=<n>", strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE));
strUsage += HelpMessageOpt("-blockprioritysize=<n>", strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), DEFAULT_BLOCK_PRIORITY_SIZE));
@@ -479,11 +480,20 @@ std::string HelpMessage(HelpMessageMode mode)
std::string LicenseInfo()
{
+ const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>";
+ const std::string URL_WEBSITE = "<https://bitcoincore.org>";
// todo: remove urls from translations on next change
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
- _("This is experimental software.") + "\n" +
+ strprintf(_("Please contribute if you find %s useful. "
+ "Visit %s for further information about the software."),
+ PACKAGE_NAME, URL_WEBSITE) +
+ "\n" +
+ strprintf(_("The source code is available from %s."),
+ URL_SOURCE_CODE) +
+ "\n" +
"\n" +
+ _("This is experimental software.") + "\n" +
_("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.") + "\n" +
"\n" +
_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.") +
@@ -1274,6 +1284,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
break;
}
+ if (!fReindex) {
+ uiInterface.InitMessage(_("Rewinding blocks..."));
+ if (!RewindBlockIndex(chainparams)) {
+ strLoadError = _("Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain");
+ break;
+ }
+ }
+
uiInterface.InitMessage(_("Verifying blocks..."));
if (fHavePruned && GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks",
@@ -1308,8 +1326,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (!fLoaded) {
// first suggest a reindex
if (!fReset) {
- bool fRet = uiInterface.ThreadSafeMessageBox(
+ bool fRet = uiInterface.ThreadSafeQuestion(
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"),
+ strLoadError + ".\nPlease restart with -reindex or -reindex-chainstate to recover.",
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);
if (fRet) {
fReindex = true;
@@ -1368,6 +1387,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
+ if (Params().GetConsensus().vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout != 0) {
+ // Only advertize witness capabilities if they have a reasonable start time.
+ // This allows us to have the code merged without a defined softfork, by setting its
+ // end time to 0.
+ // Note that setting NODE_WITNESS is never required: the only downside from not
+ // doing so is that after activation, no upgraded nodes will fetch from you.
+ nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS);
+ // Only care about others providing witness capabilities if there is a softfork
+ // defined.
+ nRelevantServices = ServiceFlags(nRelevantServices | NODE_WITNESS);
+ }
+
// ********************************************************* Step 10: import blocks
if (mapArgs.count("-blocknotify"))