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
Commits
6a8414bc
Commit
6a8414bc
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockstore Allkeys: ignore non multihash keys
parent
0d059a38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
blocks/blockstore/blockstore.go
blocks/blockstore/blockstore.go
+10
-0
No files found.
blocks/blockstore/blockstore.go
View file @
6a8414bc
...
...
@@ -133,6 +133,13 @@ func (bs *blockstore) AllKeysChan(ctx context.Context, offset int, limit int) (<
// need to convert to u.Key using u.KeyFromDsKey.
k
=
u
.
KeyFromDsKey
(
ds
.
NewKey
(
e
.
Key
))
log
.
Debug
(
"blockstore: query got key"
,
k
)
// key must be a multihash. else ignore it.
_
,
err
:=
mh
.
Cast
([]
byte
(
k
))
if
err
!=
nil
{
return
""
,
true
}
return
k
,
true
}
}
...
...
@@ -149,6 +156,9 @@ func (bs *blockstore) AllKeysChan(ctx context.Context, offset int, limit int) (<
if
!
ok
{
return
}
if
k
==
""
{
continue
}
select
{
case
<-
ctx
.
Done
()
:
...
...
This diff is collapsed.
Click to expand it.
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