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