-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
questionFurther information is requestedFurther information is requested
Description
This code skips ohttp_relay selection when ohttp_keys are hard coded and default chooses the 0 index relay of the possible relays.
rust-payjoin/payjoin-cli/src/app/v2/ohttp.rs
Lines 30 to 47 in 762fbaf
| pub(crate) async fn unwrap_ohttp_keys_or_else_fetch( | |
| config: &Config, | |
| directory: Option<url::Url>, | |
| relay_manager: Arc<Mutex<RelayManager>>, | |
| ) -> Result<ValidatedOhttpKeys> { | |
| if let Some(ohttp_keys) = config.v2()?.ohttp_keys.clone() { | |
| println!("Using OHTTP Keys from config"); | |
| return Ok(ValidatedOhttpKeys { | |
| ohttp_keys, | |
| relay_url: config.v2()?.ohttp_relays[0].clone(), | |
| }); | |
| } else { | |
| println!("Bootstrapping private network transport over Oblivious HTTP"); | |
| let fetched_keys = fetch_ohttp_keys(config, directory, relay_manager).await?; | |
| Ok(fetched_keys) | |
| } | |
| } |
While skipping reaching out to the relay when you already have an ohttp-key may make sense, and even be desirable for initial key grab, as it has already been set, whether through a cache or otherwise. We should still utilize a randomized relay selection for followup connections to update the state of a payjoin.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested