let config = match matches.value_of("esplora") {
Some(base_url) => AnyBlockchainConfig::Esplora(EsploraBlockchainConfig {
base_url: base_url.to_string(),
+ concurrency: matches
+ .value_of("esplora_concurrency")
+ .and_then(|v| v.parse::<u8>().ok()),
}),
None => AnyBlockchainConfig::Electrum(ElectrumBlockchainConfig {
url: matches.value_of("server").unwrap().to_string(),
);
if cfg!(feature = "esplora") {
- app = app.arg(
- Arg::with_name("esplora")
- .short("e")
- .long("esplora")
- .value_name("ESPLORA")
- .help("Use the esplora server if given as parameter")
- .takes_value(true),
- );
+ app = app
+ .arg(
+ Arg::with_name("esplora")
+ .short("e")
+ .long("esplora")
+ .value_name("ESPLORA")
+ .help("Use the esplora server if given as parameter")
+ .takes_value(true),
+ )
+ .arg(
+ Arg::with_name("esplora_concurrency")
+ .long("esplora_concurrency")
+ .value_name("ESPLORA_CONCURRENCY")
+ .help("Concurrency of requests made to the esplora server")
+ .default_value("4")
+ .takes_value(true),
+ )
}
if cfg!(feature = "electrum") {