skip peers with bad ports without raising

This commit is contained in:
Victor Shyba 2022-07-25 09:27:45 -03:00 committed by Victor Shyba
parent df77392fe0
commit da2ffb000e

View file

@ -206,8 +206,12 @@ class Crawler:
self.probed_streams_metric.labels("global").inc() self.probed_streams_metric.labels("global").inc()
if response and response.found: if response and response.found:
self.announced_streams_metric.labels("global").inc() self.announced_streams_metric.labels("global").inc()
blob_peers = [decode_tcp_peer_from_compact_address(compact_addr) blob_peers = []
for compact_addr in response.found_compact_addresses] for compact_addr in response.found_compact_addresses:
try:
blob_peers.append(decode_tcp_peer_from_compact_address(compact_addr))
except ValueError as e:
log.error("Error decoding compact peers: %s", e)
for blob_peer in blob_peers: for blob_peer in blob_peers:
response = await self.request_peers(blob_peer.address, blob_peer.tcp_port, blob_peer.node_id, sd_hash) response = await self.request_peers(blob_peer.address, blob_peer.tcp_port, blob_peer.node_id, sd_hash)
if response: if response: