diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-02-18 12:57:39 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-05-10 19:07:42 +0200 |
commit | 02a0899527ba3d31329e56c791c9dbf36075bb84 (patch) | |
tree | b2535958d42b97f1d5c5f819ca400a9741b90479 /src/node/blockmanager_args.cpp | |
parent | a498d699e3fdac5bfdb33020a1fd6c4a79989752 (diff) |
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.
Diffstat (limited to 'src/node/blockmanager_args.cpp')
-rw-r--r-- | src/node/blockmanager_args.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node/blockmanager_args.cpp b/src/node/blockmanager_args.cpp index 9c320243e1..179c3a4604 100644 --- a/src/node/blockmanager_args.cpp +++ b/src/node/blockmanager_args.cpp @@ -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 |