Skip to content

Commit 8da1e43

Browse files
committed
Merge #18910: p2p: add MAX_FEELER_CONNECTIONS constant
e3047ed test: use p2p constants in denial of service tests (fanquake) 25d8264 p2p: add MAX_FEELER_CONNECTIONS constant (tryphe) Pull request description: Extracted from #16003. ACKs for top commit: naumenkogs: utACK e3047ed Tree-SHA512: 14fc15292be4db2e825a0331dd189a48713464f622a91c589122c1a7135bcfd37a61e64af1e76d32880ded09c24efd54d3c823467d6c35367a380e0be33bd35f
2 parents e45fb7e + e3047ed commit 8da1e43

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,7 @@ bool AppInitMain(NodeContext& node)
18871887
connOptions.m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, connOptions.nMaxConnections);
18881888
connOptions.m_max_outbound_block_relay = std::min(MAX_BLOCKS_ONLY_CONNECTIONS, connOptions.nMaxConnections-connOptions.m_max_outbound_full_relay);
18891889
connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS;
1890-
connOptions.nMaxFeeler = 1;
1890+
connOptions.nMaxFeeler = MAX_FEELER_CONNECTIONS;
18911891
connOptions.nBestHeight = chain_active_height;
18921892
connOptions.uiInterface = &uiInterface;
18931893
connOptions.m_banman = node.banman.get();

src/net.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ static const int MAX_OUTBOUND_FULL_RELAY_CONNECTIONS = 8;
6262
static const int MAX_ADDNODE_CONNECTIONS = 8;
6363
/** Maximum number of block-relay-only outgoing connections */
6464
static const int MAX_BLOCKS_ONLY_CONNECTIONS = 2;
65+
/** Maximum number of feeler connections */
66+
static const int MAX_FEELER_CONNECTIONS = 1;
6567
/** -listen default */
6668
static const bool DEFAULT_LISTEN = true;
6769
/** -upnp default */

src/test/denialofservice_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management)
151151
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, *m_node.scheduler, *m_node.mempool);
152152

153153
const Consensus::Params& consensusParams = Params().GetConsensus();
154-
constexpr int max_outbound_full_relay = 8;
154+
constexpr int max_outbound_full_relay = MAX_OUTBOUND_FULL_RELAY_CONNECTIONS;
155155
CConnman::Options options;
156-
options.nMaxConnections = 125;
156+
options.nMaxConnections = DEFAULT_MAX_PEER_CONNECTIONS;
157157
options.m_max_outbound_full_relay = max_outbound_full_relay;
158-
options.nMaxFeeler = 1;
158+
options.nMaxFeeler = MAX_FEELER_CONNECTIONS;
159159

160160
connman->Init(options);
161161
std::vector<CNode *> vNodes;

0 commit comments

Comments
 (0)