Fix crash when --in-peers & --out-peers both 0 (#14598)

This commit is contained in:
Dmitry Markin authored and GitHub committed 2023-07-20 18:19:19 +03:00
1 parent 14b086263e
commit 0b2e7d4df5
3 files changed
+7 -3

No files matched your search

+3 -1
View File
@@ -785,12 +785,14 @@ where
};
let (state_request_protocol_config, state_request_protocol_name) = {
let num_peer_hint = net_config.network_config.default_peers_set_num_full as usize +
net_config.network_config.default_peers_set.reserved_nodes.len();
// Allow both outgoing and incoming requests.
let (handler, protocol_config) = StateRequestHandler::new(
&protocol_id,
config.chain_spec.fork_id(),
client.clone(),
net_config.network_config.default_peers_set_num_full as usize,
num_peer_hint,
);
let config_name = protocol_config.name.clone();