This repository was archived by the owner on Dec 10, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,11 @@ pub fn cli_parse() -> NodeConfig {
178
178
. arg ( Arg :: with_name ( "tcp-connections-limit" )
179
179
. short ( "c" )
180
180
. long ( "tcp-connections-limit" )
181
- . help ( "Maximum number of active TCP connections relay can hold" )
181
+ . help ( "Maximum number of active TCP connections relay can hold. \
182
+ Defaults to 512 when tcp-address is specified")
182
183
. requires ( "tcp-address" )
183
184
. takes_value ( true )
184
- . default_value ( "512" ) )
185
+ . default_value_if ( "tcp-address" , None , "512" ) )
185
186
. arg ( Arg :: with_name ( "secret-key" )
186
187
. short ( "s" )
187
188
. long ( "secret-key" )
@@ -298,7 +299,11 @@ fn run_args(matches: &ArgMatches) -> NodeConfig {
298
299
Vec :: new ( )
299
300
} ;
300
301
301
- let tcp_connections_limit = value_t ! ( matches. value_of( "tcp-connections-limit" ) , usize ) . unwrap_or_else ( |e| e. exit ( ) ) ;
302
+ let tcp_connections_limit = if matches. is_present ( "tcp-connections-limit" ) {
303
+ value_t ! ( matches. value_of( "tcp-connections-limit" ) , usize ) . unwrap_or_else ( |e| e. exit ( ) )
304
+ } else {
305
+ 512
306
+ } ;
302
307
303
308
let sk = matches. value_of ( "secret-key" ) . map ( |s| {
304
309
let sk_bytes: [ u8 ; 32 ] = FromHex :: from_hex ( s) . expect ( "Invalid DHT secret key" ) ;
You can’t perform that action at this time.
0 commit comments