mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-18 11:57:37 -05:00
![TheCharlatan](/assets/img/avatar_default.png)
This is an extraction of ArgsManager related functions from util/system into their own common file. Config file related functions are moved to common/config.cpp. The background of this commit is an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager. The ArgsManager belongs into the common library, since the kernel library should not depend on it. See doc/design/libraries.md for more information on this rationale.
18 lines
691 B
C++
18 lines
691 B
C++
// 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/database_args.h>
|
|
|
|
#include <common/args.h>
|
|
#include <dbwrapper.h>
|
|
|
|
namespace node {
|
|
void ReadDatabaseArgs(const ArgsManager& args, DBOptions& options)
|
|
{
|
|
// Settings here apply to all databases (chainstate, blocks, and index
|
|
// databases), but it'd be easy to parse database-specific options by adding
|
|
// a database_type string or enum parameter to this function.
|
|
if (auto value = args.GetBoolArg("-forcecompactdb")) options.force_compact = *value;
|
|
}
|
|
} // namespace node
|