net processing: clamp -blockreconstructionextratxn to uint32_t bounds

Also changes max_extra_txs into a uint32_t to avoid platform-specific
behaviour
This commit is contained in:
stickies-v
2023-07-25 15:49:36 +01:00
parent e451d1e3c6
commit 547fa52443
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& optio
}
if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
options.max_extra_txs = size_t(std::max(int64_t{0}, *value));
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;