diff --git a/stackslib/src/net/api/postblock_proposal.rs b/stackslib/src/net/api/postblock_proposal.rs index a725677780..e5377a782f 100644 --- a/stackslib/src/net/api/postblock_proposal.rs +++ b/stackslib/src/net/api/postblock_proposal.rs @@ -192,10 +192,11 @@ fn get_test_delay() -> Option { #[cfg(any(test, feature = "testing"))] fn inject_validation_delay() { - if let Some(delay) = get_test_delay() { - warn!("Sleeping for {} seconds to simulate slow processing", delay); - thread::sleep(Duration::from_secs(delay)); - } + let Some(delay) = get_test_delay() else { + return; + }; + warn!("Sleeping for {} seconds to simulate slow processing", delay); + thread::sleep(Duration::from_secs(delay)); } /// Represents a block proposed to the `v3/block_proposal` endpoint for validation