Commit e00a1479 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #3307 from ipfs/feat/raw-nodes

Implement 'Raw Node' node type
parents c38ced03 bc1f635b
...@@ -37,8 +37,11 @@ func NewBlock(data []byte) *BasicBlock { ...@@ -37,8 +37,11 @@ func NewBlock(data []byte) *BasicBlock {
// we are able to be confident that the data is correct // we are able to be confident that the data is correct
func NewBlockWithCid(data []byte, c *cid.Cid) (*BasicBlock, error) { func NewBlockWithCid(data []byte, c *cid.Cid) (*BasicBlock, error) {
if u.Debug { if u.Debug {
// TODO: fix assumptions chkc, err := c.Prefix().Sum(data)
chkc := cid.NewCidV0(u.Hash(data)) if err != nil {
return nil, err
}
if !chkc.Equals(c) { if !chkc.Equals(c) {
return nil, ErrWrongHash return nil, ErrWrongHash
} }
......
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