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
df4b5452
Commit
df4b5452
authored
Dec 08, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(bootstrap) reduce interface
License: MIT Signed-off-by:
Brian Tiger Chow
<
brian@perfmode.com
>
parent
7b5eff5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
core/bootstrap.go
core/bootstrap.go
+3
-3
core/core.go
core/core.go
+1
-1
No files found.
core/bootstrap.go
View file @
df4b5452
...
...
@@ -20,8 +20,8 @@ const (
)
func
superviseConnections
(
parent
context
.
Context
,
n
*
IpfsNode
,
route
*
dht
.
IpfsDHT
,
n
inet
.
Network
,
route
*
dht
.
IpfsDHT
,
// TODO depend on abstract interface for testing purposes
store
peer
.
Peerstore
,
peers
[]
*
config
.
BootstrapPeer
)
error
{
...
...
@@ -29,7 +29,7 @@ func superviseConnections(parent context.Context,
ctx
,
_
:=
context
.
WithTimeout
(
parent
,
connectiontimeout
)
// TODO get config from disk so |peers| always reflects the latest
// information
if
err
:=
bootstrap
(
ctx
,
n
.
Network
,
route
,
store
,
peers
);
err
!=
nil
{
if
err
:=
bootstrap
(
ctx
,
n
,
route
,
store
,
peers
);
err
!=
nil
{
log
.
Error
(
err
)
}
select
{
...
...
core/core.go
View file @
df4b5452
...
...
@@ -185,7 +185,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (n *IpfsNode, err error) {
// an Exchange, Network, or Routing component and have the constructor
// manage the wiring. In that scenario, this dangling function is a bit
// awkward.
go
superviseConnections
(
ctx
,
n
,
dhtRouting
,
n
.
Peerstore
,
n
.
Config
.
Bootstrap
)
go
superviseConnections
(
ctx
,
n
.
Network
,
dhtRouting
,
n
.
Peerstore
,
n
.
Config
.
Bootstrap
)
}
// TODO(brian): when offline instantiate the BlockService with a bitswap
...
...
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