explicit peering part 3

This commit is contained in:
Giovanni Petrantoni 2020-06-23 17:01:05 +09:00
parent f8292f7086
commit 99b982c21d

View File

@ -316,6 +316,14 @@ proc handleGraft(g: GossipSub,
trace "processing graft message", peer = peer.id,
topicID = graft.topicID
# It is an error to GRAFT on a explicit peer
if peer.peerInfo.maintain:
trace "attempt to graft an explicit peer", peer=peer.id,
topicID=graft.topicID
# and such an attempt should be logged and rejected with a PRUNE
respControl.prune.add(ControlPrune(topicID: graft.topicID))
continue
if graft.topicID in g.topics:
if g.mesh.len < GossipSubD:
g.mesh[graft.topicID].incl(peer.id)