mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-20 18:00:04 +00:00
triage publish nil peers (issue is on master too but just hidden behind a if/in)
This commit is contained in:
parent
f49e59cb4e
commit
a976c22dae
@ -499,9 +499,18 @@ method publish*(g: GossipSub,
|
||||
continue
|
||||
|
||||
let peer = g.peers.getOrDefault(p)
|
||||
if not isNil(peer.peerInfo):
|
||||
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:
|
||||
# Notice this needs a better fix! for now it's a hack
|
||||
error "publish: peer or peerInfo was nil"
|
||||
if topic in g.mesh:
|
||||
g.mesh[topic].excl(p)
|
||||
if topic in g.fanout:
|
||||
g.fanout[topic].excl(p)
|
||||
if topic in g.gossipsub:
|
||||
g.gossipsub[topic].excl(p)
|
||||
|
||||
sent = await allFinished(sent)
|
||||
checkFutures(sent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user