From 6097008edf4982efaa9867a47ea36104be4a44e9 Mon Sep 17 00:00:00 2001 From: Benalleng Date: Fri, 6 Mar 2026 15:58:04 -0500 Subject: [PATCH] Ensure random relay selection with fixed ohttp-keys config This fixes a bug whereby the relay selection was skipped if the config set a fixed value for the ohttp-keys. --- payjoin-cli/src/app/v2/ohttp.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/payjoin-cli/src/app/v2/ohttp.rs b/payjoin-cli/src/app/v2/ohttp.rs index eecf85cf3..4ee637ecb 100644 --- a/payjoin-cli/src/app/v2/ohttp.rs +++ b/payjoin-cli/src/app/v2/ohttp.rs @@ -34,10 +34,8 @@ pub(crate) async fn unwrap_ohttp_keys_or_else_fetch( ) -> Result { 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(), - }); + let validated = fetch_ohttp_keys(config, directory, relay_manager).await?; + Ok(ValidatedOhttpKeys { ohttp_keys, relay_url: validated.relay_url }) } else { println!("Bootstrapping private network transport over Oblivious HTTP"); let fetched_keys = fetch_ohttp_keys(config, directory, relay_manager).await?;