From 7dff7da4f5eafa89546565a63362e57516e4064e Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Fri, 24 Feb 2023 14:09:27 -0500 Subject: [PATCH 1/2] init: Return more fitting ChainStateLoadStatus if verification was interrupted This also avoids a misleading block index loadtime log entry in init. Co-authored-by: Ryan Ofsky --- src/node/chainstate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 41c0ff21184..626010d26f7 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -198,9 +198,10 @@ ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager& chainman, const C options.check_blocks); switch (result) { case VerifyDBResult::SUCCESS: - case VerifyDBResult::INTERRUPTED: case VerifyDBResult::SKIPPED_MISSING_BLOCKS: break; + case VerifyDBResult::INTERRUPTED: + return {ChainstateLoadStatus::INTERRUPTED, _("Block verification was interrupted")}; case VerifyDBResult::CORRUPTED_BLOCK_DB: return {ChainstateLoadStatus::FAILURE, _("Corrupted block database detected")}; case VerifyDBResult::SKIPPED_L3_CHECKS: From c5825e14f8999a8c5f5121027af9e07ac51ab42e Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Fri, 24 Feb 2023 14:02:47 -0500 Subject: [PATCH 2/2] doc: add explanation for fail_on_insufficient_dbcache --- src/node/chainstate.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node/chainstate.h b/src/node/chainstate.h index 7838a62d0c6..77240cafe93 100644 --- a/src/node/chainstate.h +++ b/src/node/chainstate.h @@ -25,6 +25,10 @@ struct ChainstateLoadOptions { bool reindex{false}; bool reindex_chainstate{false}; bool prune{false}; + //! Setting require_full_verification to true will require all checks at + //! check_level (below) to succeed for loading to succeed. Setting it to + //! false will skip checks if cache is not big enough to run them, so may be + //! helpful for running with a small cache. bool require_full_verification{true}; int64_t check_blocks{DEFAULT_CHECKBLOCKS}; int64_t check_level{DEFAULT_CHECKLEVEL};