Cleanup TCP throttling code (performance) + move connection checks

This commit is contained in:
Lee *!* Clagett 2024-08-27 14:07:52 -04:00
parent 893916ad09
commit 7e766e13c3
7 changed files with 93 additions and 34 deletions

View file

@ -224,6 +224,18 @@ TEST(ban, subnet)
test_core pr_core;
cryptonote::t_cryptonote_protocol_handler<test_core> cprotocol(pr_core, NULL);
Server server(cprotocol);
{
boost::program_options::options_description opts{};
Server::init_options(opts);
cryptonote::core::init_options(opts);
char** args = nullptr;
boost::program_options::variables_map vm;
boost::program_options::store(
boost::program_options::parse_command_line(0, args, opts), vm
);
server.init(vm);
}
cprotocol.set_p2p_endpoint(&server);
ASSERT_TRUE(server.block_subnet(MAKE_IPV4_SUBNET(1,2,3,4,24), 10));