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 <pfista@gmail.com>
Michael Pfister committed
Apr 18, 2016 at 13:32 UTC
437d6b6585aa4ac0ad2f1919e0627ee36171f64c
1 file changed
+2
namesys/routing.go
+2
@@ -2,6 +2,7 @@ package namesys
2
3
import (
4
"fmt"
5
+ "strings"
6
"time"
7
8
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
123
return cached, nil
124
}
125
126
+ name = strings.TrimPrefix(name, "/ipns/")
127
hash, err := mh.FromB58String(name)
128
if err != nil {
129
// name should be a multihash. if it isn't, error out here.