aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/netstore.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/storage/netstore.go')
-rw-r--r--swarm/storage/netstore.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go
index 80ac6f198..a3a552232 100644
--- a/swarm/storage/netstore.go
+++ b/swarm/storage/netstore.go
@@ -24,9 +24,8 @@ import (
"sync/atomic"
"time"
- "github.com/ethereum/go-ethereum/p2p/discover"
+ "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/swarm/log"
-
lru "github.com/hashicorp/golang-lru"
)
@@ -36,7 +35,7 @@ type (
type NetFetcher interface {
Request(ctx context.Context)
- Offer(ctx context.Context, source *discover.NodeID)
+ Offer(ctx context.Context, source *enode.ID)
}
// NetStore is an extension of local storage
@@ -265,10 +264,11 @@ func (f *fetcher) Fetch(rctx context.Context) (Chunk, error) {
// If there is a source in the context then it is an offer, otherwise a request
sourceIF := rctx.Value("source")
if sourceIF != nil {
- var source *discover.NodeID
- id := discover.MustHexID(sourceIF.(string))
- source = &id
- f.netFetcher.Offer(rctx, source)
+ var source enode.ID
+ if err := source.UnmarshalText([]byte(sourceIF.(string))); err != nil {
+ return nil, err
+ }
+ f.netFetcher.Offer(rctx, &source)
} else {
f.netFetcher.Request(rctx)
}