skip peers using flux ports before adding to queue (#20)

This commit is contained in:
Conrado Gouvea 2022-06-14 11:59:04 -03:00 committed by GitHub
parent 309a0064b5
commit c0b68332d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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
}
}
}
}