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:
parent
1d95720e5e
commit
892b3ad8e4
|
@ -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")
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue