2023-04-20 13:05:23 +02:00
|
|
|
#include <node/peerman_args.h>
|
|
|
|
|
|
|
|
#include <common/args.h>
|
|
|
|
#include <net_processing.h>
|
|
|
|
|
2023-07-25 15:41:54 +01:00
|
|
|
#include <algorithm>
|
|
|
|
#include <limits>
|
|
|
|
|
2023-04-20 13:05:23 +02:00
|
|
|
namespace node {
|
|
|
|
|
|
|
|
void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options)
|
|
|
|
{
|
2023-04-20 13:33:11 +02:00
|
|
|
if (auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value;
|
|
|
|
|
|
|
|
if (auto value{argsman.GetIntArg("-maxorphantx")}) {
|
2023-07-25 15:41:54 +01:00
|
|
|
options.max_orphan_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
|
2023-04-20 13:33:11 +02:00
|
|
|
}
|
2023-04-20 13:49:00 +02:00
|
|
|
|
|
|
|
if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
|
2023-07-25 15:49:36 +01:00
|
|
|
options.max_extra_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
|
2023-04-20 13:49:00 +02:00
|
|
|
}
|
2023-04-20 13:50:47 +02:00
|
|
|
|
|
|
|
if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value;
|
2023-07-25 12:08:08 +01:00
|
|
|
|
|
|
|
if (auto value{argsman.GetBoolArg("-blocksonly")}) options.ignore_incoming_txs = *value;
|
2023-04-20 13:05:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace node
|
|
|
|
|