refactor: Add stop_at_height option in ChainstateManager

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

This should eventually allow users of the ChainstateManager to not rely
on the global gArgs and instead pass in their own options.
This commit is contained in:
TheCharlatan
2023-05-04 23:04:35 +02:00
parent 214f8f18b3
commit ef95be334f
4 changed files with 6 additions and 4 deletions

View File

@@ -37,6 +37,8 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& args, ChainstateManage
if (auto value{args.GetIntArg("-maxtipage")}) opts.max_tip_age = std::chrono::seconds{*value};
if (auto value{args.GetIntArg("-stopatheight")}) opts.stop_at_height = *value;
ReadDatabaseArgs(args, opts.block_tree_db);
ReadDatabaseArgs(args, opts.coins_db);
ReadCoinsViewArgs(args, opts.coins_view);