From 6a982a2ec98735bb3a1424adf02b5cb719f51126 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 11 Sep 2024 17:58:43 -0300 Subject: [PATCH] use conditional compilation --- zebra-rpc/src/methods.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zebra-rpc/src/methods.rs b/zebra-rpc/src/methods.rs index d72ffa5d288..a97b7fe132e 100644 --- a/zebra-rpc/src/methods.rs +++ b/zebra-rpc/src/methods.rs @@ -302,6 +302,7 @@ pub trait Rpc { address_strings: AddressStrings, ) -> BoxFuture>>; + #[cfg(not(target_os = "windows"))] #[rpc(name = "stop")] /// Stop the running zebrad process. /// @@ -1357,8 +1358,9 @@ where .boxed() } + #[cfg(not(target_os = "windows"))] fn stop(&self) -> Result { - if self.network.is_regtest() && cfg!(not(target_os = "windows")) { + if self.network.is_regtest() { match nix::sys::signal::raise(nix::sys::signal::SIGINT) { Ok(_) => Ok("Zebra server stopping".to_string()), Err(error) => Err(Error { @@ -1370,8 +1372,7 @@ where } else { Err(Error { code: ErrorCode::MethodNotFound, - message: "stop is only available on *nix platforms and regtest networks" - .to_string(), + message: "stop is only available on regtest networks".to_string(), data: None, }) }