mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-08 15:53:07 +00:00
fix import & var naming
This commit is contained in:
parent
9ad332dd1d
commit
23e30d529a
@ -3,7 +3,6 @@ package pubsub
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/libp2p/go-libp2p-core/record"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -14,6 +13,7 @@ import (
|
|||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
"github.com/libp2p/go-libp2p-core/peerstore"
|
"github.com/libp2p/go-libp2p-core/peerstore"
|
||||||
"github.com/libp2p/go-libp2p-core/protocol"
|
"github.com/libp2p/go-libp2p-core/protocol"
|
||||||
|
"github.com/libp2p/go-libp2p-core/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -830,14 +830,14 @@ func (gs *GossipSubRouter) makePrune(p peer.ID, topic string) *pb.ControlPrune {
|
|||||||
return p != xp
|
return p != xp
|
||||||
})
|
})
|
||||||
|
|
||||||
cab, peerstoreSupportsSignedAddrs := peerstore.GetCertifiedAddrBook(gs.p.host.Peerstore())
|
cab, ok := peerstore.GetCertifiedAddrBook(gs.p.host.Peerstore())
|
||||||
px := make([]*pb.PeerInfo, 0, len(peers))
|
px := make([]*pb.PeerInfo, 0, len(peers))
|
||||||
for _, p := range peers {
|
for _, p := range peers {
|
||||||
// see if we have a signed peer record to send back; if we don't, just send
|
// see if we have a signed peer record to send back; if we don't, just send
|
||||||
// the peer ID and let the pruned peer find them in the DHT -- we can't trust
|
// the peer ID and let the pruned peer find them in the DHT -- we can't trust
|
||||||
// unsigned address records through px anyway.
|
// unsigned address records through px anyway.
|
||||||
var recordBytes []byte
|
var recordBytes []byte
|
||||||
if peerstoreSupportsSignedAddrs {
|
if ok {
|
||||||
spr := cab.GetPeerRecord(p)
|
spr := cab.GetPeerRecord(p)
|
||||||
var err error
|
var err error
|
||||||
if spr != nil {
|
if spr != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user