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
e00a1479
Commit
e00a1479
authored
Oct 24, 2016
by
Jeromy Johnson
Committed by
GitHub
Oct 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3307 from ipfs/feat/raw-nodes
Implement 'Raw Node' node type
parents
c38ced03
bc1f635b
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 @
e00a1479
...
...
@@ -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