From 92e2f5205c892978cf9b13e3e3dda8fef1840e84 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 24 Mar 2023 17:08:24 +1000 Subject: [PATCH] Ignore Firo non-Zcash nodes in Zebra's address book (#6398) --- zebra-network/src/peer/priority.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/zebra-network/src/peer/priority.rs b/zebra-network/src/peer/priority.rs index d50130e70..c79d30e7a 100644 --- a/zebra-network/src/peer/priority.rs +++ b/zebra-network/src/peer/priority.rs @@ -123,9 +123,14 @@ fn address_is_valid_for_outbound_connections( return Err( "invalid peer port: port is for Regtest, but Zebra does not support that network", ); - } else if [16125, 26125].contains(&peer_addr.port()) { - // 16125/26125 is used by Flux/ZelCash, which uses the same network magic numbers as Zcash, - // so we have to reject it by port + } else if [16125, 26125, 8168, 18168, 38168].contains(&peer_addr.port()) { + // 16125/26125 are used by Flux/ZelCash, which uses the same network magic numbers as Zcash, + // so we have to reject it by port: + // - https://github.com/RunOnFlux/fluxd/blob/master/src/zelnode/zelnodeconfig.cpp#L76 + // - https://github.com/RunOnFlux/fluxd/blob/master/src/init.cpp#L409 + // 8168/18168/38168 are used by Firo/Zcoin, which uses the same network magic numbers as Zcash, + // so we have to reject it by port: + // - https://github.com/firoorg/firo/blob/master/src/chainparamsseeds.h return Err("invalid peer port: port is for a non-Zcash network"); } }