mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
refactor, dbwrapper: Add DBParams and DBOptions structs
Add DBParams and DBOptions structs to remove ArgsManager uses from dbwrapper. To reduce size of this commit, this moves references to gArgs variable out of dbwrapper.cpp to calling code in txdb.cpp. But these moves are temporary. The gArgs references in txdb.cpp are moved out to calling code in init.cpp in later commits. This commit does not change behavior.
This commit is contained in:
18
src/node/database_args.cpp
Normal file
18
src/node/database_args.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
// 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 <dbwrapper.h>
|
||||
#include <util/system.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
|
||||
Reference in New Issue
Block a user