Commit 360f29fa authored by Jeromy's avatar Jeromy

send discovery off into its own goroutine

License: MIT
Signed-off-by: default avatarJeromy <why@ipfs.io>
parent 44c9bb80
......@@ -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{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment