From 8d3eceacc0fc67665cea9553be6e3f287349e673 Mon Sep 17 00:00:00 2001 From: "W. J. van der Laan" Date: Thu, 30 Sep 2021 12:32:56 +0200 Subject: [PATCH] Merge bitcoin/bitcoin#23130: doc: Revert "Remove outdated comments" and place comment correctly 8ff3743f5e99c693710bc446bfd595687156ca6b Revert "doc: Remove outdated comments" (Hennadii Stepanov) Pull request description: Unfortunately, in #23094 the assumption that #14336 makes comments outdated is wrong. As pointed in https://github.com/bitcoin/bitcoin/pull/23094#discussion_r717226839, the #14336 just moved the relevant code a few lines down. This PR reverts commit ee7891a0c412728cf8bec667f25263682a9baaaf, and moves the comments into the right place. I apologize about that. ACKs for top commit: MarcoFalke: cr ACK 8ff3743f5e99c693710bc446bfd595687156ca6b laanwj: ACK 8ff3743f5e99c693710bc446bfd595687156ca6b Tree-SHA512: 84aca627bb5b49c06fc172778f9b9407482c5a873ccbc3dc40167e6a8ad0bc60475d6a469c843b7b42712e35cf3fc2d3518923e791d5e0c59628e042acc72747 --- src/init.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index baf81eb0cd..5089df5a62 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1268,6 +1268,8 @@ bool AppInitParameterInteraction(const ArgsManager& args) #else int fd_max = FD_SETSIZE; #endif + // Trim requested connection counts, to fit into system limitations + // in std::min(...) to work around FreeBSD compilation issue described in #2695 nMaxConnections = std::max(std::min(nMaxConnections, fd_max - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS - NUM_FDS_MESSAGE_CAPTURE), 0); if (nFD < MIN_CORE_FILEDESCRIPTORS) return InitError(_("Not enough file descriptors available."));