Skip to content

Commit

Permalink
feat: allow routing commands offline
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Mar 21, 2023
1 parent e05d060 commit 323a218
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions core/coreapi/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ import (
"errors"

"github.com/ipfs/go-path"
coreiface "github.com/ipfs/interface-go-ipfs-core"
peer "github.com/libp2p/go-libp2p/core/peer"
)

type RoutingAPI CoreAPI

func (r *RoutingAPI) Get(ctx context.Context, key string) ([]byte, error) {
if !r.nd.IsOnline {
return nil, coreiface.ErrOffline
}

dhtKey, err := normalizeKey(key)
if err != nil {
return nil, err
Expand All @@ -25,10 +20,6 @@ func (r *RoutingAPI) Get(ctx context.Context, key string) ([]byte, error) {
}

func (r *RoutingAPI) Put(ctx context.Context, key string, value []byte) error {
if !r.nd.IsOnline {
return coreiface.ErrOffline
}

dhtKey, err := normalizeKey(key)
if err != nil {
return err
Expand Down

0 comments on commit 323a218

Please sign in to comment.