From fbbccdd7a484d162f998be6521e931ee7800743f Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:53:08 +0200 Subject: [PATCH] fixes #508: Fix `has_sufficient_peer_connectivity` for peerless networks --- rpc/service/src/service.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rpc/service/src/service.rs b/rpc/service/src/service.rs index d498f522f6..21e8d38c52 100644 --- a/rpc/service/src/service.rs +++ b/rpc/service/src/service.rs @@ -270,8 +270,12 @@ impl RpcCoreService { } fn has_sufficient_peer_connectivity(&self) -> bool { - // Other network types can be used in an isolated environment without peers - !matches!(self.flow_context.config.net.network_type, Mainnet | Testnet) || self.flow_context.hub().has_peers() + if matches!(self.flow_context.config.net.network_type, Mainnet | Testnet) { + self.flow_context.hub().has_peers() + } else { + // Other network types can be used in an isolated environment without peers + true + } } fn extract_tx_query(&self, filter_transaction_pool: bool, include_orphan_pool: bool) -> RpcResult {