Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
peerman_args.cpp
Go to the documentation of this file.
1#include <node/peerman_args.h>
2
3#include <common/args.h>
4#include <net_processing.h>
5
6#include <algorithm>
7#include <limits>
8
9namespace node {
10
12 PeerManager::Options &options) {
13 if (auto value{argsman.GetIntArg("-maxorphantx")}) {
14 options.max_orphan_txs = uint32_t(std::clamp<int64_t>(
15 *value, 0, std::numeric_limits<uint32_t>::max()));
16 }
17
18 if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
19 options.max_extra_txs = uint32_t(std::clamp<int64_t>(
20 *value, 0, std::numeric_limits<uint32_t>::max()));
21 }
22
23 if (auto value{argsman.GetBoolArg("-capturemessages")}) {
24 options.capture_messages = *value;
25 }
26
27 if (auto value{argsman.GetBoolArg("-blocksonly")}) {
28 options.ignore_incoming_txs = *value;
29 }
30
31 if (auto value{argsman.GetIntArg("-maxaddrtosend")}) {
32 options.max_addr_to_send = size_t(std::max(int64_t{0}, *value));
33 }
34
35 if (auto value{argsman.GetIntArg("-avacooldown")}) {
36 options.avalanche_cooldown = std::max(int64_t{0}, *value);
37 }
38
39 if (auto value{argsman.GetIntArg("-avalanchepeerreplacementcooldown")}) {
41 std::max(int64_t{0}, *value);
42 }
43
44 if (auto value{argsman.GetBoolArg("-avalanchepreconsensus")}) {
45 options.avalanche_preconsensus = *value;
46 }
47}
48
49} // namespace node
std::optional< bilingual_str > ApplyArgsManOptions(const ArgsManager &argsman, const CChainParams &chainparams, MemPoolOptions &mempool_opts)
Overlay the options set in argsman on top of corresponding members in mempool_opts.
Definition init.h:28
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
int64_t avalanche_cooldown
Minimum time between two AVAPOLL messages.
size_t max_addr_to_send
Number of addresses a node may send in an ADDR message.
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 avalanche_preconsensus
Whether this node has enabled avalanche preconsensus.
int64_t avalanche_peer_replacement_cooldown
Minimum time before we will consider replacing a finalized proof with a conflicting one.
bool ignore_incoming_txs
Whether this node is running in -blocksonly mode.
bool capture_messages
Whether all P2P messages are captured to disk.