mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 13:34:26 +00:00
don't check if peers have sendConn
when disconnecting for bad scoring
This commit is contained in:
parent
51d8cd4ade
commit
922cd92f94
@ -82,13 +82,12 @@ proc disconnectPeer(g: GossipSub, peer: PubSubPeer) {.async.} =
|
||||
else:
|
||||
libp2p_gossipsub_bad_score_disconnection.inc(labelValues = ["unknown"])
|
||||
|
||||
if peer.sendConn != nil:
|
||||
try:
|
||||
await g.switch.disconnect(peer.peerId)
|
||||
except CancelledError:
|
||||
raise
|
||||
except CatchableError as exc:
|
||||
trace "Failed to close connection", peer, error = exc.name, msg = exc.msg
|
||||
try:
|
||||
await g.switch.disconnect(peer.peerId)
|
||||
except CancelledError:
|
||||
raise
|
||||
except CatchableError as exc:
|
||||
trace "Failed to close connection", peer, error = exc.name, msg = exc.msg
|
||||
|
||||
proc updateScores*(g: GossipSub) = # avoid async
|
||||
trace "updating scores", peers = g.peers.len
|
||||
|
Loading…
x
Reference in New Issue
Block a user