Skip to content

Commit

Permalink
comments from CR
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
  • Loading branch information
whyrusleeping committed Jul 27, 2015
1 parent 3fb9b9e commit 94672e2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion blocks/blockstore/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/corerouting/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Repo interface {
// Datastore is the interface required from a datastore to be
// acceptable to FSRepo.
type Datastore interface {
ds.Datastore // should be threadsafe, just be careful
Batch() (ds.Batch, error)
Close() error
ds.Batching // should be threadsafe, just be careful
io.Closer
}
4 changes: 2 additions & 2 deletions routing/supernode/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 94672e2

Please sign in to comment.