From f190c155d333bb6099be93d9b34bd5c7e9d7a2ec Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Thu, 3 Oct 2019 13:29:28 -0600 Subject: [PATCH] don't throw on missing peer --- libp2p/protocols/pubsub/floodsub.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/protocols/pubsub/floodsub.nim b/libp2p/protocols/pubsub/floodsub.nim index c00e11ca6..e4e4833de 100644 --- a/libp2p/protocols/pubsub/floodsub.nim +++ b/libp2p/protocols/pubsub/floodsub.nim @@ -88,7 +88,7 @@ proc rpcHandler(f: FloodSub, # forward the message to all peers interested in it for p in toSendPeers: - if f.peers[p].id != peer.id: + if p in f.peers and f.peers[p].id != peer.id: await f.peers[p].send(@[RPCMsg(messages: m.messages)]) proc handleConn(f: FloodSub,