2022-07-20 12:16:30 -04:00
|
|
|
// Copyright (c) 2022 The Bitcoin Core developers
|
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
|
|
#include <node/chainstatemanager_args.h>
|
|
|
|
|
|
|
|
|
|
#include <util/system.h>
|
|
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
|
|
namespace node {
|
|
|
|
|
void ApplyArgsManOptions(const ArgsManager& args, ChainstateManager::Options& opts)
|
|
|
|
|
{
|
2022-07-20 16:00:11 -04:00
|
|
|
if (auto value{args.GetArg("-assumevalid")}) opts.assumed_valid_block = uint256S(*value);
|
|
|
|
|
|
2022-07-20 12:16:30 -04:00
|
|
|
if (auto value{args.GetIntArg("-maxtipage")}) opts.max_tip_age = std::chrono::seconds{*value};
|
|
|
|
|
}
|
|
|
|
|
} // namespace node
|