From 7c148c95c22a9852f46f05d3ee887335c53721d1 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 04:56:38 +0100 Subject: main: call relay_only only with libp2p feature --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 617ca94..8d4ce73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,6 +62,8 @@ async fn main() -> Result<()> { "Options of a transport this node doesn't use are ignored" ); } + // Only with libp2p: without, `config` refuses `relay-only` already. + #[cfg(feature = "libp2p")] if args.relay_only { return relay_only(args).await; } @@ -359,11 +361,6 @@ async fn relay_only(args: &config::Settings) -> Result<()> { Ok(()) } -#[cfg(not(feature = "libp2p"))] -async fn relay_only(_args: &config::Settings) -> Result<()> { - anyhow::bail!("relay-only relays over libp2p; this build has no libp2p") -} - /// Turns SIGINT and SIGTERM into a shutdown request. A second signal exits at once (the /// supervised Mycelium still gets its parent-death signal then). fn watch_for_shutdown() -> Result> { -- cgit v1.3.1