From 777160f164b8c187c534debd293157031e9f3a02 Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Tue, 22 Aug 2023 13:56:56 +0200 Subject: [PATCH 1/2] add provider record addresses to peerstore fixes issue #868 --- handlers.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/handlers.go b/handlers.go index ada7338a4..580a2c827 100644 --- a/handlers.go +++ b/handlers.go @@ -16,7 +16,6 @@ import ( "github.com/libp2p/go-libp2p-kad-dht/internal" pb "github.com/libp2p/go-libp2p-kad-dht/pb" recpb "github.com/libp2p/go-libp2p-record/pb" - "github.com/multiformats/go-base32" ) // dhthandler specifies the signature of functions that handle DHT messages. @@ -359,7 +358,7 @@ func (dht *IpfsDHT) handleAddProvider(ctx context.Context, p peer.ID, pmes *pb.M continue } - dht.providerStore.AddProvider(ctx, key, peer.AddrInfo{ID: p}) + dht.providerStore.AddProvider(ctx, key, peer.AddrInfo{ID: pi.ID, Addrs: pi.Addrs}) } return nil, nil From b5644934e46ed25dc5f8ed6ddefa481b2d942579 Mon Sep 17 00:00:00 2001 From: guillaumemichel Date: Tue, 22 Aug 2023 15:11:21 +0200 Subject: [PATCH 2/2] fixing base32 import --- handlers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers.go b/handlers.go index 580a2c827..1a4603be3 100644 --- a/handlers.go +++ b/handlers.go @@ -16,6 +16,7 @@ import ( "github.com/libp2p/go-libp2p-kad-dht/internal" pb "github.com/libp2p/go-libp2p-kad-dht/pb" recpb "github.com/libp2p/go-libp2p-record/pb" + "github.com/multiformats/go-base32" ) // dhthandler specifies the signature of functions that handle DHT messages.