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-dms3-blockstore
Commits
bc4a13fd
Commit
bc4a13fd
authored
Dec 10, 2014
by
Jeromy
Committed by
Juan Batiz-Benet
Dec 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockstore.ErrNotFound, and proper wantlist sorting
parent
9a4a84b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
blockstore.go
blockstore.go
+6
-1
No files found.
blockstore.go
View file @
bc4a13fd
...
@@ -6,14 +6,16 @@ import (
...
@@ -6,14 +6,16 @@ import (
"errors"
"errors"
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
blocks
"github.com/jbenet/go-ipfs/blocks"
blocks
"github.com/jbenet/go-ipfs/blocks"
u
"github.com/jbenet/go-ipfs/util"
u
"github.com/jbenet/go-ipfs/util"
)
)
var
ValueTypeMismatch
=
errors
.
New
(
"The retrieved value is not a Block"
)
var
ValueTypeMismatch
=
errors
.
New
(
"The retrieved value is not a Block"
)
var
ErrNotFound
=
errors
.
New
(
"blockstore: block not found"
)
// Blockstore wraps a ThreadSafeDatastore
// Blockstore wraps a ThreadSafeDatastore
type
Blockstore
interface
{
type
Blockstore
interface
{
DeleteBlock
(
u
.
Key
)
error
DeleteBlock
(
u
.
Key
)
error
...
@@ -34,6 +36,9 @@ type blockstore struct {
...
@@ -34,6 +36,9 @@ type blockstore struct {
func
(
bs
*
blockstore
)
Get
(
k
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
func
(
bs
*
blockstore
)
Get
(
k
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
maybeData
,
err
:=
bs
.
datastore
.
Get
(
k
.
DsKey
())
maybeData
,
err
:=
bs
.
datastore
.
Get
(
k
.
DsKey
())
if
err
==
ds
.
ErrNotFound
{
return
nil
,
ErrNotFound
}
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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