Skip to content

Commit 78b1cf5

Browse files
magik6kStebalien
authored andcommitted
coreapi: dht: simplify the implementation
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> This commit was moved from ipfs/interface-go-ipfs-core@22a12c2
1 parent 0e411a6 commit 78b1cf5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coreiface/dht.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ package iface
33
import (
44
"context"
55

6-
options "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
6+
"github.com/ipfs/go-ipfs/core/coreapi/interface/options"
77

88
peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer"
9-
ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr"
9+
pstore "gx/ipfs/Qmda4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore"
1010
)
1111

1212
// DhtAPI specifies the interface to the DHT
1313
type DhtAPI interface {
1414
// FindPeer queries the DHT for all of the multiaddresses associated with a
1515
// Peer ID
16-
FindPeer(context.Context, peer.ID) (<-chan ma.Multiaddr, error)
16+
FindPeer(context.Context, peer.ID) (pstore.PeerInfo, error)
1717

1818
// FindProviders finds peers in the DHT who can provide a specific value
1919
// given a key.
20-
FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan peer.ID, error) //TODO: is path the right choice here?
20+
FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan pstore.PeerInfo, error)
2121

2222
// WithNumProviders is an option for FindProviders which specifies the
2323
// number of peers to look for. Default is 20

0 commit comments

Comments
 (0)