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-blockservice
Commits
e7295a1b
Commit
e7295a1b
authored
Mar 01, 2018
by
Jakub Sztandera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
//hash -> // hash
License: MIT Signed-off-by:
Jakub Sztandera
<
kubuxu@protonmail.ch
>
parent
48e84b32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
blockservice.go
blockservice.go
+3
-3
No files found.
blockservice.go
View file @
e7295a1b
...
...
@@ -155,7 +155,7 @@ func (s *blockService) AddBlock(o blocks.Block) error {
}
func
(
s
*
blockService
)
AddBlocks
(
bs
[]
blocks
.
Block
)
error
{
//hash security
//
hash security
for
_
,
b
:=
range
bs
{
err
:=
verifcid
.
ValidateCid
(
b
.
Cid
())
if
err
!=
nil
{
...
...
@@ -202,7 +202,7 @@ func (s *blockService) GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block,
f
=
s
.
exchange
}
return
getBlock
(
ctx
,
c
,
s
.
blockstore
,
f
)
//hash security
return
getBlock
(
ctx
,
c
,
s
.
blockstore
,
f
)
//
hash security
}
func
getBlock
(
ctx
context
.
Context
,
c
*
cid
.
Cid
,
bs
blockstore
.
Blockstore
,
f
exchange
.
Fetcher
)
(
blocks
.
Block
,
error
)
{
...
...
@@ -242,7 +242,7 @@ func getBlock(ctx context.Context, c *cid.Cid, bs blockstore.Blockstore, f excha
// the returned channel.
// NB: No guarantees are made about order.
func
(
s
*
blockService
)
GetBlocks
(
ctx
context
.
Context
,
ks
[]
*
cid
.
Cid
)
<-
chan
blocks
.
Block
{
return
getBlocks
(
ctx
,
ks
,
s
.
blockstore
,
s
.
exchange
)
//hash security
return
getBlocks
(
ctx
,
ks
,
s
.
blockstore
,
s
.
exchange
)
//
hash security
}
func
getBlocks
(
ctx
context
.
Context
,
ks
[]
*
cid
.
Cid
,
bs
blockstore
.
Blockstore
,
f
exchange
.
Fetcher
)
<-
chan
blocks
.
Block
{
...
...
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