From 378c4e278033e8f697afffaa147a456a84e490e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Tue, 17 Jul 2018 15:22:14 +0200 Subject: [PATCH] Node: `--connections` now implies `--peer-table-size` --- src/bin_node/node_shared_arg.ml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bin_node/node_shared_arg.ml b/src/bin_node/node_shared_arg.ml index b3b0949b4..bc7351f2b 100644 --- a/src/bin_node/node_shared_arg.ml +++ b/src/bin_node/node_shared_arg.ml @@ -74,13 +74,18 @@ let wrap (* when `--expected-connections` is used, override all the bounds defined in the configuration file. *) let bootstrap_threshold, - min_connections, expected_connections, max_connections = + min_connections, expected_connections, max_connections, + peer_table_size = match connections with - | None -> bootstrap_threshold, None, None, None + | None -> bootstrap_threshold, None, None, None, peer_table_size | Some x -> + let peer_table_size = + match peer_table_size with + | None -> Some (8*x) + | Some _ -> peer_table_size in begin match bootstrap_threshold with - | None -> Some (min (x/4) 2), Some (x/2), Some x, Some (3*x/2) - | Some bs -> Some bs, Some (x/2), Some x, Some (3*x/2) + | None -> Some (min (x/4) 2), Some (x/2), Some x, Some (3*x/2), peer_table_size + | Some bs -> Some bs, Some (x/2), Some x, Some (3*x/2), peer_table_size end in { data_dir ;