Skip to content

Commit

Permalink
Avoid name conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Warehime committed Sep 5, 2023
1 parent 9481a1f commit ee634b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions network/p2p/dht/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func dhtProtocolPrefix(network string) protocol.ID {
// MakeDHT creates the dht.IpfsDHT object
func MakeDHT(ctx context.Context, h host.Host, network string, cfg config.Local, bootstrapPeers []*peer.AddrInfo) (*dht.IpfsDHT, error) {
var peers []peer.AddrInfo
for _, peer := range bootstrapPeers {
if peer != nil {
peers = append(peers, *peer)
for _, bPeer := range bootstrapPeers {
if bPeer != nil {
peers = append(peers, *bPeer)
}
}
dhtCfg := []dht.Option{
Expand Down
7 changes: 6 additions & 1 deletion network/p2p/dht/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ func TestDHTBasic(t *testing.T) {

h, err := libp2p.New()
require.NoError(t, err)
dht, err := MakeDHT(context.Background(), h, "devtestnet", config.GetDefaultLocal(), []*peer.AddrInfo{})
dht, err := MakeDHT(
context.Background(),
h,
"devtestnet",
config.GetDefaultLocal(),
[]*peer.AddrInfo{{}})
require.NoError(t, err)
_, err = MakeDiscovery(dht)
require.NoError(t, err)
Expand Down

0 comments on commit ee634b4

Please sign in to comment.