From 437d6b6585aa4ac0ad2f1919e0627ee36171f64c Mon Sep 17 00:00:00 2001 From: Michael Pfister Date: Mon, 18 Apr 2016 13:32:03 -0700 Subject: [PATCH] ipfs name resolve --local fixed multihash error resolveOnce should remove '/ipns/' prefix before using multihash functions. Fixes #2527 License: MIT Signed-off-by: Mike Pfister --- namesys/routing.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/namesys/routing.go b/namesys/routing.go index 1520bfb68..6db13dfb0 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -2,6 +2,7 @@ package namesys import ( "fmt" + "strings" "time" lru "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/hashicorp/golang-lru" @@ -122,6 +123,7 @@ func (r *routingResolver) resolveOnce(ctx context.Context, name string) (path.Pa return cached, nil } + name = strings.TrimPrefix(name, "/ipns/") hash, err := mh.FromB58String(name) if err != nil { // name should be a multihash. if it isn't, error out here.