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
f819c6c5
Commit
f819c6c5
authored
Sep 04, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix blockservice error ignorance
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
75d6f9ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
blockservice.go
blockservice.go
+9
-3
No files found.
blockservice.go
View file @
f819c6c5
...
...
@@ -96,19 +96,25 @@ func (s *BlockService) GetBlock(ctx context.Context, k key.Key) (*blocks.Block,
block
,
err
:=
s
.
Blockstore
.
Get
(
k
)
if
err
==
nil
{
return
block
,
nil
}
if
err
==
blockstore
.
ErrNotFound
&&
s
.
Exchange
!=
nil
{
// TODO be careful checking ErrNotFound. If the underlying
// implementation changes, this will break.
}
else
if
err
==
blockstore
.
ErrNotFound
&&
s
.
Exchange
!=
nil
{
log
.
Debug
(
"Blockservice: Searching bitswap."
)
blk
,
err
:=
s
.
Exchange
.
GetBlock
(
ctx
,
k
)
if
err
!=
nil
{
return
nil
,
err
}
return
blk
,
nil
}
else
{
}
log
.
Debug
(
"Blockservice GetBlock: Not found."
)
if
err
==
blockstore
.
ErrNotFound
{
return
nil
,
ErrNotFound
}
return
nil
,
err
}
// GetBlocks gets a list of blocks asynchronously and returns through
...
...
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