validation: allow to specify frequency for -checkblockindex
This makes it similar to -checkaddrman and -checkmempool, which also allow to run the check occasionally instead of always / never. Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
1 parent
d5a631b959
commit
5bc2077e8f
6 files changed
+16
-5
No files matched your search
@@ -24,7 +24,10 @@
|
||||
namespace node {
|
||||
util::Result<void> ApplyArgsManOptions(const ArgsManager& args, ChainstateManager::Options& opts)
|
||||
{
|
||||
if (auto value{args.GetBoolArg("-checkblockindex")}) opts.check_block_index = *value;
|
||||
if (auto value{args.GetIntArg("-checkblockindex")}) {
|
||||
// Interpret bare -checkblockindex argument as 1 instead of 0.
|
||||
opts.check_block_index = args.GetArg("-checkblockindex")->empty() ? 1 : *value;
|
||||
}
|
||||
|
||||
if (auto value{args.GetBoolArg("-checkpoints")}) opts.checkpoints_enabled = *value;
|
||||
|
||||
|
||||
Reference in new issue
Block a user