Bitcoin Core 29.99.0
P2P Digital Currency
peerman_args.cpp
Go to the documentation of this file.
1// Copyright (c) 2023-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://opensource.org/license/mit.
4
5#include <node/peerman_args.h>
6
7#include <common/args.h>
8#include <net_processing.h>
9
10#include <algorithm>
11#include <limits>
12
13namespace node {
14
16{
17 if (auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value;
18
19 if (auto value{argsman.GetIntArg("-maxorphantx")}) {
20 options.max_orphan_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
21 }
22
23 if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
24 options.max_extra_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
25 }
26
27 if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value;
28
29 if (auto value{argsman.GetBoolArg("-blocksonly")}) options.ignore_incoming_txs = *value;
30}
31
32} // namespace node
33
if(!SetupNetworking())
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
Definition: args.cpp:482
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: args.cpp:507
Definition: messages.h:20
util::Result< void > ApplyArgsManOptions(const ArgsManager &args, BlockManager::Options &opts)
bool reconcile_txs
Whether transaction reconciliation protocol is enabled.
uint32_t max_extra_txs
Number of non-mempool transactions to keep around for block reconstruction.
uint32_t max_orphan_txs
Maximum number of orphan transactions kept in memory.
bool ignore_incoming_txs
Whether this node is running in -blocksonly mode.
bool capture_messages
Whether all P2P messages are captured to disk.