Skip to content

Commit 116b8bb

Browse files
Mariusz-Trelavogel76
authored andcommitted
Disable accept_incoming_connections in p2p-parameters settings
1 parent da6be31 commit 116b8bb

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

tests/unit/db_fixture/hived_fixture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void hived_fixture::postponed_init_impl( bool remove_db_files, config_arg_overri
9292
auto error_str = "Unit test nodes must not listen to other ones!";
9393
BOOST_REQUIRE_MESSAGE( override.first != "p2p-endpoint", error_str );
9494
BOOST_REQUIRE_MESSAGE( override.first != "p2p-seed-node", error_str );
95-
BOOST_REQUIRE_MESSAGE( override.first != "p2p-parameters", error_str );
95+
//BOOST_REQUIRE_MESSAGE( override.first != "p2p-parameters", error_str );
9696
return true;
9797
}
9898
);

tests/unit/plugin_tests/witness_tests.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,27 @@ struct witness_fixture : public hived_fixture
6464
configuration_data.set_hardfork_schedule( genesis_time, { { HIVE_NUM_HARDFORKS, 1 } } );
6565
configuration_data.set_init_witnesses( initial_witnesses );
6666

67+
std::string _p2p_parameters_value =
68+
R"({
69+
"listen_endpoint": "0.0.0.0:0",
70+
"accept_incoming_connections": false,
71+
"wait_if_endpoint_is_busy": true,
72+
"private_key": "0000000000000000000000000000000000000000000000000000000000000000",
73+
"desired_number_of_connections": 20,
74+
"maximum_number_of_connections": 200,
75+
"peer_connection_retry_timeout": 30,
76+
"peer_inactivity_timeout": 5,
77+
"peer_advertising_disabled": false,
78+
"maximum_number_of_blocks_to_handle_at_one_time": 200,
79+
"maximum_number_of_sync_blocks_to_prefetch": 20000,
80+
"maximum_blocks_per_peer_during_syncing": 200,"active_ignored_request_timeout_microseconds":6000000
81+
}
82+
)";
83+
6784
config_arg_override_t config_args = {
6885
config_line_t( { "shared-file-size", { shared_file_size } } ),
69-
config_line_t( { "private-key", { init_account_priv_key.key_to_wif() } } )
86+
config_line_t( { "private-key", { init_account_priv_key.key_to_wif() } } ),
87+
config_line_t( { "p2p-parameters", { _p2p_parameters_value } } )
7088
};
7189
for( auto& name : represented_witnesses )
7290
config_args.emplace_back( config_line_t( "witness", { "\"" + name + "\"" } ) );

0 commit comments

Comments
 (0)