Skip to content

Commit

Permalink
renaming in error messages & local var
Browse files Browse the repository at this point in the history
  • Loading branch information
yusefnapora committed Jan 27, 2020
1 parent fd42efb commit f30aa45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gossipsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,27 +304,27 @@ func (gs *GossipSubRouter) pxConnect(peers []*pb.PeerInfo) {
continue
}

var srr *record.Envelope
var spr *record.Envelope
if pi.SignedPeerRecord != nil {
// the peer sent us a signed record; ensure that it is valid
envelope, r, err := record.ConsumeEnvelope(pi.SignedPeerRecord, peer.PeerRecordEnvelopeDomain)
if err != nil {
log.Warningf("error unmarshalling routing record obtained through px: %s", err)
log.Warnf("error unmarshalling peer record obtained through px: %s", err)
continue
}
rec, ok := r.(*peer.PeerRecord)
if !ok {
log.Warnf("bogus routing record obtained through px: envelope payload is not PeerRecord")
log.Warnf("bogus peer record obtained through px: envelope payload is not PeerRecord")
continue
}
if rec.PeerID != p {
log.Warnf("bogus routing record obtained through px: peer ID %s doesn't match expected peer %s", rec.PeerID, p)
log.Warnf("bogus peer record obtained through px: peer ID %s doesn't match expected peer %s", rec.PeerID, p)
continue
}
srr = envelope
spr = envelope
}

toconnect = append(toconnect, connectInfo{p, srr})
toconnect = append(toconnect, connectInfo{p, spr})
}

if len(toconnect) == 0 {
Expand Down

0 comments on commit f30aa45

Please sign in to comment.