renaming in error messages & local var
This commit is contained in:
parent
d860620a23
commit
559cf91dce
12
gossipsub.go
12
gossipsub.go
|
@ -306,27 +306,27 @@ func (gs *GossipSubRouter) pxConnect(peers []*pb.PeerInfo) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
var srr *record.Envelope
|
var spr *record.Envelope
|
||||||
if pi.SignedPeerRecord != nil {
|
if pi.SignedPeerRecord != nil {
|
||||||
// the peer sent us a signed record; ensure that it is valid
|
// the peer sent us a signed record; ensure that it is valid
|
||||||
envelope, r, err := record.ConsumeEnvelope(pi.SignedPeerRecord, peer.PeerRecordEnvelopeDomain)
|
envelope, r, err := record.ConsumeEnvelope(pi.SignedPeerRecord, peer.PeerRecordEnvelopeDomain)
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
rec, ok := r.(*peer.PeerRecord)
|
rec, ok := r.(*peer.PeerRecord)
|
||||||
if !ok {
|
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
|
continue
|
||||||
}
|
}
|
||||||
if rec.PeerID != p {
|
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
|
continue
|
||||||
}
|
}
|
||||||
srr = envelope
|
spr = envelope
|
||||||
}
|
}
|
||||||
|
|
||||||
toconnect = append(toconnect, connectInfo{p, srr})
|
toconnect = append(toconnect, connectInfo{p, spr})
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(toconnect) == 0 {
|
if len(toconnect) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue