refactor, BlockManager: Replace fastprune from arg with options

Remove access to the global gArgs for the fastprune argument and
replace it by adding a field to the existing BlockManager Options
struct.

When running `clang-tidy-diff` on this commit, there is a diagnostic
error: `unknown type name 'uint64_t' [clang-diagnostic-error] uint64_t
prune_target{0};`, which is fixed by including cstdint.

This should eventually allow users of the BlockManager to not rely on
the global gArgs and instead pass in their own options.
This commit is contained in:
TheCharlatan
2023-02-18 12:57:39 +01:00
parent a498d699e3
commit 02a0899527
3 changed files with 7 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ std::optional<bilingual_str> ApplyArgsManOptions(const ArgsManager& args, BlockM
}
opts.prune_target = nPruneTarget;
if (auto value{args.GetBoolArg("-fastprune")}) opts.fast_prune = *value;
return std::nullopt;
}
} // namespace node