提交 c6ee2058 作者: Jeromy

comments from CR

License: MIT
Signed-off-by: 's avatarJeromy <jeromyj@gmail.com>
上级 45d4b1a8
......@@ -166,11 +166,7 @@
},
{
"ImportPath": "github.com/jbenet/go-datastore",
<<<<<<< HEAD
"Rev": "c835c30f206c1e97172e428f052e225adab9abde"
=======
"Rev": "47af23f2ad09237ccc09c586c118048e2b39b358"
>>>>>>> fixup datastore interfaces
},
{
"ImportPath": "github.com/jbenet/go-detect-race",
......
......@@ -52,9 +52,11 @@ type GCBlockstore interface {
}
func NewBlockstore(d ds.Batching) *blockstore {
var dsb ds.Batching
dd := dsns.Wrap(d, BlockPrefix)
dsb = dd
return &blockstore{
datastore: dd,
datastore: dsb,
}
}
......
......@@ -28,7 +28,7 @@ var (
// SupernodeServer returns a configuration for a routing server that stores
// routing records to the provided datastore. Only routing records are store in
// the datastore.
func SupernodeServer(recordSource ds.ThreadSafeDatastore) core.RoutingOption {
func SupernodeServer(recordSource ds.Datastore) core.RoutingOption {
return func(ctx context.Context, ph host.Host, dstore repo.Datastore) (routing.IpfsRouting, error) {
server, err := supernode.NewServer(recordSource, ph.Peerstore(), ph.ID())
if err != nil {
......
......@@ -18,13 +18,13 @@ import (
// Server handles routing queries using a database backend
type Server struct {
local peer.ID
routingBackend datastore.ThreadSafeDatastore
routingBackend datastore.Datastore
peerstore peer.Peerstore
*proxy.Loopback // so server can be injected into client
}
// NewServer creates a new Supernode routing Server
func NewServer(ds datastore.ThreadSafeDatastore, ps peer.Peerstore, local peer.ID) (*Server, error) {
func NewServer(ds datastore.Datastore, ps peer.Peerstore, local peer.ID) (*Server, error) {
s := &Server{local, ds, ps, nil}
s.Loopback = &proxy.Loopback{
Handler: s,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论