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
360f29fa
Commit
360f29fa
authored
Sep 15, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send discovery off into its own goroutine
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
44c9bb80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
core/commands/pubsub.go
core/commands/pubsub.go
+9
-7
No files found.
core/commands/pubsub.go
View file @
360f29fa
...
...
@@ -105,14 +105,16 @@ To use, the daemon must be run with '--enable-pubsub-experiment'.
discover
,
_
,
_
:=
req
.
Option
(
"discover"
)
.
Bool
()
if
discover
{
blk
:=
blocks
.
NewBlock
([]
byte
(
"floodsub:"
+
topic
))
cid
,
err
:=
n
.
Blocks
.
AddObject
(
blk
)
if
err
!=
nil
{
log
.
Error
(
"pubsub discovery: "
,
err
)
return
}
go
func
()
{
blk
:=
blocks
.
NewBlock
([]
byte
(
"floodsub:"
+
topic
))
cid
,
err
:=
n
.
Blocks
.
AddObject
(
blk
)
if
err
!=
nil
{
log
.
Error
(
"pubsub discovery: "
,
err
)
return
}
connectToPubSubPeers
(
req
.
Context
(),
n
,
cid
)
connectToPubSubPeers
(
req
.
Context
(),
n
,
cid
)
}()
}
},
Marshalers
:
cmds
.
MarshalerMap
{
...
...
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