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

This commit is contained in:
Dmitry Markin
2023-07-20 18:19:19 +03:00
committed by GitHub
parent 14b086263e
commit 0b2e7d4df5
3 changed files with 7 additions and 3 deletions
+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();