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
e4b2ae3b
Commit
e4b2ae3b
authored
Nov 19, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests halting
parent
0abc72c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
exchange/bitswap/bitswap.go
exchange/bitswap/bitswap.go
+4
-0
routing/mock/routing.go
routing/mock/routing.go
+1
-1
No files found.
exchange/bitswap/bitswap.go
View file @
e4b2ae3b
...
...
@@ -117,6 +117,9 @@ func (bs *bitswap) GetBlocks(parent context.Context, ks []u.Key) (*blocks.Block,
}
func
(
bs
*
bitswap
)
sendWantListTo
(
ctx
context
.
Context
,
peers
<-
chan
peer
.
Peer
)
error
{
if
peers
==
nil
{
panic
(
"Cant send wantlist to nil peerchan"
)
}
message
:=
bsmsg
.
New
()
for
_
,
wanted
:=
range
bs
.
wantlist
.
Keys
()
{
message
.
AddWanted
(
wanted
)
...
...
@@ -164,6 +167,7 @@ func (bs *bitswap) run(ctx context.Context) {
for
{
select
{
case
<-
broadcastSignal
:
unsentKeys
=
0
wantlist
:=
bs
.
wantlist
.
Keys
()
if
len
(
wantlist
)
==
0
{
continue
...
...
routing/mock/routing.go
View file @
e4b2ae3b
...
...
@@ -59,7 +59,7 @@ func (mr *MockRouter) FindProviders(ctx context.Context, key u.Key) ([]peer.Peer
}
func
(
mr
*
MockRouter
)
FindPeer
(
ctx
context
.
Context
,
pid
peer
.
ID
)
(
peer
.
Peer
,
error
)
{
log
.
Debug
(
"FindPeer: %s"
,
pid
)
log
.
Debug
f
(
"FindPeer: %s"
,
pid
)
return
nil
,
nil
}
...
...
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