1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

u.Hash - error

the u.Hash error can be safely ignored (panic) because multihash
only fails from the selection of hash function. If the fn + length
are valid, it won't error.

cc @whyrusleeping
This commit is contained in:
Juan Batiz-Benet
2014-10-06 02:26:50 -07:00
parent af1ce6ee50
commit f3ae0e8e1b
10 changed files with 21 additions and 47 deletions

View File

@ -42,16 +42,9 @@ func (p *ipnsPublisher) Publish(k ci.PrivKey, value string) error {
return nil
}
nameb, err := u.Hash(pkbytes)
if err != nil {
return nil
}
nameb := u.Hash(pkbytes)
namekey := u.Key(nameb).Pretty()
ipnskey, err := u.Hash([]byte("/ipns/" + namekey))
if err != nil {
return err
}
ipnskey := u.Hash([]byte("/ipns/" + namekey))
// Store associated public key
timectx, _ := context.WithDeadline(ctx, time.Now().Add(time.Second*4))