mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
net, refactor: move calculations for connection type limits into connman
Currently the logic is fragmented between init and connman. Encapsulating this logic within connman allows for less mental overhead and easier reuse in tests. Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
committed by
Martin Zumsande
parent
97f756b12c
commit
c25e0e0555
@@ -148,8 +148,6 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management)
|
||||
constexpr int max_outbound_full_relay = MAX_OUTBOUND_FULL_RELAY_CONNECTIONS;
|
||||
CConnman::Options options;
|
||||
options.nMaxConnections = DEFAULT_MAX_PEER_CONNECTIONS;
|
||||
options.m_max_outbound_full_relay = max_outbound_full_relay;
|
||||
options.nMaxFeeler = MAX_FEELER_CONNECTIONS;
|
||||
|
||||
const auto time_init{GetTime<std::chrono::seconds>()};
|
||||
SetMockTime(time_init);
|
||||
@@ -249,8 +247,6 @@ BOOST_AUTO_TEST_CASE(block_relay_only_eviction)
|
||||
constexpr int64_t MINIMUM_CONNECT_TIME{30};
|
||||
CConnman::Options options;
|
||||
options.nMaxConnections = DEFAULT_MAX_PEER_CONNECTIONS;
|
||||
options.m_max_outbound_full_relay = MAX_OUTBOUND_FULL_RELAY_CONNECTIONS;
|
||||
options.m_max_outbound_block_relay = max_outbound_block_relay;
|
||||
|
||||
connman->Init(options);
|
||||
std::vector<CNode*> vNodes;
|
||||
|
||||
Reference in New Issue
Block a user