fix prune message in test

This commit is contained in:
Yusef Napora 2020-05-05 20:18:23 -04:00 committed by vyzo
parent b1de03b608
commit 4427c3def7
1 changed files with 1 additions and 7 deletions

View File

@ -1802,12 +1802,6 @@ func (iwe *iwantEverything) handleStream(s network.Stream) {
topic := "test"
err = w.WriteMsg(&pb.RPC{Subscriptions: []*pb.RPC_SubOpts{&pb.RPC_SubOpts{Subscribe: &truth, Topicid: &topic}}})
remotePidBytes, err := s.Conn().RemotePeer().MarshalBinary()
if err != nil {
panic(err)
}
toPrune := []*pb.PeerInfo{{PeerID: remotePidBytes}}
var rpc pb.RPC
for {
rpc.Reset()
@ -1836,7 +1830,7 @@ func (iwe *iwantEverything) handleStream(s network.Stream) {
// send a PRUNE for all grafts, so we don't get direct message deliveries
var prunes []*pb.ControlPrune
for _, graft := range rpc.Control.Graft {
prunes = append(prunes, &pb.ControlPrune{TopicID: graft.TopicID, Peers: toPrune})
prunes = append(prunes, &pb.ControlPrune{TopicID: graft.TopicID})
}
var iwants []*pb.ControlIWant