aboutsummaryrefslogtreecommitdiff
path: root/src/node/chainstate.cpp
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2022-10-06 17:11:02 -0400
committerMartin Zumsande <mzumsande@gmail.com>2023-02-16 17:58:52 -0500
commit0c7785bb2540b69564104767d38342704230cbc2 (patch)
tree722eb5a29c537f221d8041cd954f6b043dfc2f15 /src/node/chainstate.cpp
parentd6f781f1cfcbc2c2ad5ee289a0642ed00386d013 (diff)
downloadbitcoin-0c7785bb2540b69564104767d38342704230cbc2.tar.xz
init, validation: Improve handling if VerifyDB() fails due to insufficient dbcache
The rpc command verifychain now fails if the dbcache was not sufficient to complete the verification at the specified level and depth. In the same situation, the VerifyDB check during Init will now fail (and lead to an early shutdown) if the user has explicitly specified -checkblocks or -checklevel but the check couldn't be executed because of the limited cache. If the user didn't change any of the two and is using the defaults, log a warning but don't prevent the node from starting up.
Diffstat (limited to 'src/node/chainstate.cpp')
-rw-r--r--src/node/chainstate.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp
index 7d6e0f3bb0..c521b20b2a 100644
--- a/src/node/chainstate.cpp
+++ b/src/node/chainstate.cpp
@@ -197,6 +197,11 @@ ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager& chainman, const C
break;
case VerifyDBResult::CORRUPTED_BLOCK_DB:
return {ChainstateLoadStatus::FAILURE, _("Corrupted block database detected")};
+ case VerifyDBResult::SKIPPED_L3_CHECKS:
+ if (options.require_full_verification) {
+ return {ChainstateLoadStatus::FAILURE_INSUFFICIENT_DBCACHE, _("Insufficient dbcache for block verification")};
+ }
+ break;
} // no default case, so the compiler can warn about missing cases
}
}