Commit a83b9037 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

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
parent f524411f
......@@ -13,11 +13,7 @@ type Block struct {
// NewBlock creates a Block object from opaque data. It will hash the data.
func NewBlock(data []byte) (*Block, error) {
h, err := u.Hash(data)
if err != nil {
return nil, err
}
return &Block{Data: data, Multihash: h}, nil
return &Block{Data: data, Multihash: u.Hash(data)}, nil
}
// Key returns the block's Multihash as a Key value.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment