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-unixfs
Commits
8d29a325
Commit
8d29a325
authored
Sep 21, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core bugfix -- connect ctx
parent
52cefb16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
core/core.go
core/core.go
+3
-3
No files found.
core/core.go
View file @
8d29a325
...
...
@@ -121,7 +121,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
exchangeSession
=
bitswap
.
NetMessageSession
(
ctx
,
exchangeService
,
local
,
d
,
route
)
// TODO(brian): pass a context to initConnections
go
initConnections
(
cfg
,
peerstore
,
route
)
go
initConnections
(
ctx
,
cfg
,
peerstore
,
route
)
}
// TODO(brian): when offline instantiate the BlockService with a bitswap
...
...
@@ -184,7 +184,7 @@ func initIdentity(cfg *config.Config) (*peer.Peer, error) {
},
nil
}
func
initConnections
(
cfg
*
config
.
Config
,
pstore
peer
.
Peerstore
,
route
*
dht
.
IpfsDHT
)
{
func
initConnections
(
ctx
context
.
Context
,
cfg
*
config
.
Config
,
pstore
peer
.
Peerstore
,
route
*
dht
.
IpfsDHT
)
{
for
_
,
p
:=
range
cfg
.
Peers
{
if
p
.
PeerID
==
""
{
u
.
PErr
(
"error: peer does not include PeerID. %v
\n
"
,
p
)
...
...
@@ -205,7 +205,7 @@ func initConnections(cfg *config.Config, pstore peer.Peerstore, route *dht.IpfsD
continue
}
if
_
,
err
=
route
.
Connect
(
npeer
);
err
!=
nil
{
if
_
,
err
=
route
.
Connect
(
ctx
,
npeer
);
err
!=
nil
{
u
.
PErr
(
"Bootstrapping error: %v
\n
"
,
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