diff --git a/namesys/routing.go b/namesys/routing.go index c533daada..65da47a2f 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -55,19 +55,13 @@ func (r *IpnsResolver) resolveOnce(ctx context.Context, name string, options *op } name = strings.TrimPrefix(name, "/ipns/") - hash, err := mh.FromB58String(name) + pid, err := peer.IDB58Decode(name) if err != nil { // name should be a multihash. if it isn't, error out here. log.Debugf("RoutingResolver: bad input hash: [%s]\n", name) return "", 0, err } - pid, err := peer.IDFromBytes(hash) - if err != nil { - log.Debugf("RoutingResolver: could not convert public key hash %s to peer ID: %s\n", name, err) - return "", 0, err - } - // Name should be the hash of a public key retrievable from ipfs. // We retrieve the public key here to make certain that it's in the peer // store before calling GetValue() on the DHT - the DHT will call the