forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeerman_args.cpp
More file actions
29 lines (19 loc) · 913 Bytes
/
peerman_args.cpp
File metadata and controls
29 lines (19 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2023-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://opensource.org/license/mit.
#include <node/peerman_args.h>
#include <common/args.h>
#include <net_processing.h>
#include <algorithm>
#include <limits>
namespace node {
void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options)
{
if (auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value;
if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
options.max_extra_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
}
if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value;
if (auto value{argsman.GetBoolArg("-blocksonly")}) options.ignore_incoming_txs = *value;
}
} // namespace node