From 6bf3ee1d0b226d5e098f667a6c21b8be5a8bc30e Mon Sep 17 00:00:00 2001 From: DanGould Date: Tue, 10 Dec 2024 12:22:10 -0500 Subject: [PATCH] Don't pause between long polls Pausing different amounts between clients creates a fingerprint. Set the pause to spec at 0 seconds. --- payjoin-cli/src/app/v2.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/payjoin-cli/src/app/v2.rs b/payjoin-cli/src/app/v2.rs index bd16171f..dc6a9cc2 100644 --- a/payjoin-cli/src/app/v2.rs +++ b/payjoin-cli/src/app/v2.rs @@ -206,7 +206,6 @@ impl App { Ok(Some(psbt)) => return Ok(psbt), Ok(None) => { println!("No response yet."); - tokio::time::sleep(std::time::Duration::from_secs(5)).await; } Err(re) => { println!("{}", re); @@ -245,9 +244,8 @@ impl App { .process_res(ohttp_response.bytes().await?.to_vec().as_slice(), context) .map_err(|_| anyhow!("GET fallback failed"))?; log::debug!("got response"); - match proposal { - Some(proposal) => break Ok(proposal), - None => std::thread::sleep(std::time::Duration::from_secs(5)), + if let Some(proposal) = proposal { + break Ok(proposal); } } }