From 6faebe844cf34c7ddd92bf3c4970302911ae1f63 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Tue, 22 Oct 2019 09:40:00 -0700 Subject: [PATCH] Make zebra-network::Config toml-able. The toml serializer function we are using -- maybe because of to_string_pretty (?) barfs on structs that mix ordering of simple values and "tables", so just keep all the Durations to the end. --- zebra-network/src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zebra-network/src/config.rs b/zebra-network/src/config.rs index aad65cdb..4096fea4 100644 --- a/zebra-network/src/config.rs +++ b/zebra-network/src/config.rs @@ -16,12 +16,15 @@ pub struct Config { /// /// XXX this should be replaced with DNS names, not SocketAddrs pub initial_peers: Vec, + /// The outgoing request buffer size for the peer set. + pub peerset_request_buffer_size: usize, + + // Note: due to the way this is rendered by the toml + // serializer, the Duration fields should come last. /// The default RTT estimate for peer responses, used in load-balancing. pub ewma_default_rtt: Duration, /// The decay time for the exponentially-weighted moving average response time. pub ewma_decay_time: Duration, - /// The outgoing request buffer size for the peer set. - pub peerset_request_buffer_size: usize, /// The timeout for peer handshakes. pub handshake_timeout: Duration, /// How frequently we attempt to connect to a new peer.