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-bitswap
Commits
ac563d76
Commit
ac563d76
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
70c89ffb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
strategy/strategy.go
strategy/strategy.go
+1
-1
wantlist/wantlist.go
wantlist/wantlist.go
+1
-1
No files found.
strategy/strategy.go
View file @
ac563d76
...
@@ -68,7 +68,7 @@ func (s *strategist) getSendableBlocks(wantlist *wl.Wantlist, bs bstore.Blocksto
...
@@ -68,7 +68,7 @@ func (s *strategist) getSendableBlocks(wantlist *wl.Wantlist, bs bstore.Blocksto
var
outblocks
[]
*
blocks
.
Block
var
outblocks
[]
*
blocks
.
Block
for
_
,
e
:=
range
wantlist
.
Entries
()
{
for
_
,
e
:=
range
wantlist
.
Entries
()
{
block
,
err
:=
bs
.
Get
(
e
.
Value
)
block
,
err
:=
bs
.
Get
(
e
.
Value
)
if
err
==
u
.
ErrNotFound
{
if
err
==
bstore
.
ErrNotFound
{
continue
continue
}
}
if
err
!=
nil
{
if
err
!=
nil
{
...
...
wantlist/wantlist.go
View file @
ac563d76
...
@@ -43,7 +43,7 @@ type entrySlice []*Entry
...
@@ -43,7 +43,7 @@ type entrySlice []*Entry
func
(
es
entrySlice
)
Len
()
int
{
return
len
(
es
)
}
func
(
es
entrySlice
)
Len
()
int
{
return
len
(
es
)
}
func
(
es
entrySlice
)
Swap
(
i
,
j
int
)
{
es
[
i
],
es
[
j
]
=
es
[
j
],
es
[
i
]
}
func
(
es
entrySlice
)
Swap
(
i
,
j
int
)
{
es
[
i
],
es
[
j
]
=
es
[
j
],
es
[
i
]
}
func
(
es
entrySlice
)
Less
(
i
,
j
int
)
bool
{
return
es
[
i
]
.
Priority
<
es
[
j
]
.
Priority
}
func
(
es
entrySlice
)
Less
(
i
,
j
int
)
bool
{
return
es
[
i
]
.
Priority
>
es
[
j
]
.
Priority
}
func
(
w
*
Wantlist
)
Entries
()
[]
*
Entry
{
func
(
w
*
Wantlist
)
Entries
()
[]
*
Entry
{
var
es
entrySlice
var
es
entrySlice
...
...
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