From 8945f91465bc3ba418688684a2c29c384cd79647 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 15 Jun 2020 09:47:50 +0300 Subject: [PATCH] only do PX on leave if PX was enabled in the node --- gossipsub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gossipsub.go b/gossipsub.go index 5f82724..0a158b4 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -1005,7 +1005,7 @@ func (gs *GossipSubRouter) sendGraft(p peer.ID, topic string) { } func (gs *GossipSubRouter) sendPrune(p peer.ID, topic string) { - prune := []*pb.ControlPrune{gs.makePrune(p, topic, true)} + prune := []*pb.ControlPrune{gs.makePrune(p, topic, gs.doPX)} out := rpcWithControl(nil, nil, nil, nil, prune) gs.sendRPC(p, out) }