mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
refactor, txdb: Add CoinsViewOptions struct
Add CoinsViewOptions struct to remove ArgsManager uses from txdb. To reduce size of this commit, this moves references to gArgs variable out of txdb.cpp to calling code in validation.cpp. But these moves are temporary. The gArgs references in validation.cpp are moved out to calling code in init.cpp in later commits. This commit does not change behavior.
This commit is contained in:
parent
2eaeded37f
commit
c00fa1a734
8 changed files with 72 additions and 40 deletions
16
src/node/coins_view_args.cpp
Normal file
16
src/node/coins_view_args.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// 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/coins_view_args.h>
|
||||
|
||||
#include <txdb.h>
|
||||
#include <util/system.h>
|
||||
|
||||
namespace node {
|
||||
void ReadCoinsViewArgs(const ArgsManager& args, CoinsViewOptions& options)
|
||||
{
|
||||
if (auto value = args.GetIntArg("-dbbatchsize")) options.batch_write_bytes = *value;
|
||||
if (auto value = args.GetIntArg("-dbcrashratio")) options.simulate_crash_ratio = *value;
|
||||
}
|
||||
} // namespace node
|
||||
Loading…
Add table
Add a link
Reference in a new issue