From 73cefce79816cf98ac8d6952ebed38846cf7a99e Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni Date: Tue, 7 Jul 2020 19:42:36 +0900 Subject: [PATCH] remove assertion in publish --- libp2p/protocols/pubsub/gossipsub.nim | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index 9e3ec488b..1f6b159fe 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -473,15 +473,11 @@ method publish*(g: GossipSub, continue let peer = g.peers.getOrDefault(p) + # This can actually happen, between heartbeats we might + # still have peers in the mesh table but actually disconnected if not isNil(peer) and not isNil(peer.peerInfo): trace "publish: sending message to peer", peer = p sent.add(peer.send(@[RPCMsg(messages: @[msg])])) - else: - # this absolutely should not happen - # if it happens there is a bug that needs fixing asap - # this ain't no place to manage connections - fatal "publish: peer or peerInfo was nil", missing = p - doAssert(false, "publish: peer or peerInfo was nil") sent = await allFinished(sent) checkFutures(sent)