mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 22:32:13 +00:00
fsrepo: Refactor to extract datastore internals
License: MIT Signed-off-by: Tommi Virtanen <tv@eagain.net>
This commit is contained in:
parent
bc9ceab87e
commit
efe932a2f2
4
dht.go
4
dht.go
@ -44,7 +44,7 @@ type IpfsDHT struct {
|
||||
self peer.ID // Local peer (yourself)
|
||||
peerstore peer.Peerstore // Peer Registry
|
||||
|
||||
datastore ds.ThreadSafeDatastore // Local data
|
||||
datastore ds.Datastore // Local data
|
||||
|
||||
routingTable *kb.RoutingTable // Array of routing tables for differently distanced nodes
|
||||
providers *ProviderManager
|
||||
@ -60,7 +60,7 @@ type IpfsDHT struct {
|
||||
}
|
||||
|
||||
// NewDHT creates a new DHT object with the given peer as the 'local' host
|
||||
func NewDHT(ctx context.Context, h host.Host, dstore ds.ThreadSafeDatastore) *IpfsDHT {
|
||||
func NewDHT(ctx context.Context, h host.Host, dstore ds.Datastore) *IpfsDHT {
|
||||
dht := new(IpfsDHT)
|
||||
dht.datastore = dstore
|
||||
dht.self = h.ID()
|
||||
|
Loading…
x
Reference in New Issue
Block a user