Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-block-format
Commits
bc1f635b
Commit
bc1f635b
authored
Oct 15, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unixfs: allow use of raw merkledag nodes for unixfs files
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
9a4a2e3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
blocks.go
blocks.go
+5
-2
No files found.
blocks.go
View file @
bc1f635b
...
...
@@ -37,8 +37,11 @@ func NewBlock(data []byte) *BasicBlock {
// we are able to be confident that the data is correct
func
NewBlockWithCid
(
data
[]
byte
,
c
*
cid
.
Cid
)
(
*
BasicBlock
,
error
)
{
if
u
.
Debug
{
// TODO: fix assumptions
chkc
:=
cid
.
NewCidV0
(
u
.
Hash
(
data
))
chkc
,
err
:=
c
.
Prefix
()
.
Sum
(
data
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
chkc
.
Equals
(
c
)
{
return
nil
,
ErrWrongHash
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment