cli: Use QUIC if the default TPU does *not* use UDP (#29141)

cli: Use QUIC if the default TPU behavior uses QUIC
This commit is contained in:
Jon Cinque 2022-12-07 23:12:46 +01:00 committed by GitHub
parent 1d95720e5e
commit 892b3ad8e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -90,6 +90,13 @@ pub fn get_clap_app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> A
.global(true)
.help("Use QUIC when sending transactions."),
)
.arg(
Arg::with_name("use_udp")
.long("use-udp")
.global(true)
.conflicts_with("use_quic")
.help("Use UDP when sending transactions."),
)
.arg(
Arg::with_name("no_address_labels")
.long("no-address-labels")

View File

@ -17,6 +17,7 @@ use {
},
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_rpc_client_api::config::RpcSendTransactionConfig,
solana_tpu_client::tpu_connection_cache::DEFAULT_TPU_ENABLE_UDP,
std::{collections::HashMap, error, path::PathBuf, sync::Arc, time::Duration},
};
@ -202,7 +203,13 @@ pub fn parse_args<'a>(
config.address_labels
};
let use_quic = matches.is_present("use_quic");
let use_quic = if matches.is_present("use_quic") {
true
} else if matches.is_present("use_udp") {
false
} else {
!DEFAULT_TPU_ENABLE_UDP
};
Ok((
CliConfig {