From c0b68332d59f2137e8cdf522c5c7e79a4250d094 Mon Sep 17 00:00:00 2001 From: Conrado Gouvea Date: Tue, 14 Jun 2022 11:59:04 -0300 Subject: [PATCH] skip peers using flux ports before adding to queue (#20) --- zcash/client_callbacks.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zcash/client_callbacks.go b/zcash/client_callbacks.go index c67e2cb..e650c44 100644 --- a/zcash/client_callbacks.go +++ b/zcash/client_callbacks.go @@ -58,7 +58,10 @@ func (s *Seeder) onAddr(p *peer.Peer, msg *wire.MsgAddr) { s.logger.Printf("Already knew about %s:%d", na.IP, na.Port) continue } - s.addrQueue <- na + _, denied := DeniedPorts[na.Port] + if !denied { + s.addrQueue <- na + } } } @@ -84,7 +87,10 @@ func (s *Seeder) onAddrV2(p *peer.Peer, msg *wire.MsgAddrV2) { s.logger.Printf("Already knew about %s:%d", na.IP, na.Port) continue } - s.addrQueue <- &na.NetAddress + _, denied := DeniedPorts[na.Port] + if !denied { + s.addrQueue <- &na.NetAddress + } } } }