#include #include #include #include #include namespace node { void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options) { if (auto value{argsman.GetIntArg("-maxstaleoutbound")}) { options.maxstaleoutbound = std::clamp(*value, 0, std::numeric_limits::max()); } if (auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value; if (auto value{argsman.GetIntArg("-maxorphantx")}) { options.max_orphan_txs = uint32_t((std::clamp(*value, 0, std::numeric_limits::max()))); } if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) { options.max_extra_txs = uint32_t((std::clamp(*value, 0, std::numeric_limits::max()))); } if (auto value{argsman.GetFixedPointArg("-blockreconstructionextratxnsize", /*decimals=*/ 4)}) { // NOTE: GetFixedPointArg only allows values up to 18 digits options.max_extra_txs_size = 100 * (size_t)std::clamp(*value, 0, std::numeric_limits::max() / 100); } if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value; if (auto value{argsman.GetBoolArg("-blocksonly")}) options.ignore_incoming_txs = *value; } } // namespace node