From bd6c3846376e330c5c776179497671897298a8e4 Mon Sep 17 00:00:00 2001 From: MrSlosh Date: Fri, 16 Nov 2018 16:35:45 -0600 Subject: [PATCH] Fixes suggested by LTA for PR #42 --- src/init.cpp | 2 +- src/main.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index abab3bc..566f28e 100755 --- a/src/init.cpp +++ b/src/init.cpp @@ -322,7 +322,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-seednode=", _("Connect to a node to retrieve peer addresses, and disconnect")); strUsage += HelpMessageOpt("-timeout=", strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT)); strUsage += HelpMessageOpt("-bloomfilters", _("Allow peers to set bloom filters (default: 1)")); - strUsage += HelpMessageOpt("-fastsync", _("Increases maximum number of blocks to download at any given time and only minimal validates blocks")); + strUsage += HelpMessageOpt("-fastsync", _("Increases maximum number of in-flight blocks and only perform minimal block validation")); #ifdef USE_UPNP #if USE_UPNP strUsage += HelpMessageOpt("-upnp", _("Use UPnP to map the listening port (default: 1 when listening)")); diff --git a/src/main.cpp b/src/main.cpp index a9cca10..5d04cd5 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -2699,7 +2699,7 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot) { // Shortcut checks for almost all early blocks - if(chainActive.Height() < SKIP_VALIDATION_HEIGHT || GetBoolArg("-fastsync", false)) + if(chainActive.Height() < SKIP_VALIDATION_HEIGHT && GetBoolArg("-fastsync", false)) { const CChainParams& chainParams = Params(); // hit all the checkpoints but skip most of the rest @@ -2889,7 +2889,8 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc } // Since we're close to chaintip, reenable checks to ensure state is correct when sync completes - if(chainActive.Height() >= SKIP_VALIDATION_HEIGHT || GetBoolArg("-fastsync", false)) + // Also reenable checks if -fastsync is not set + if(chainActive.Height() >= SKIP_VALIDATION_HEIGHT || (GetBoolArg("-fastsync", false) == false)) { if (!CheckBlockHeader(block, state)) return false;