@cryptotaxi247 / kubo / commits / ac8a88d05

fix(pubsub): flood publish

When publishing a value, flood. This ensures that our messages make it to the network even if some of our peers are bad and/or overloaded.

Steven Allen committed May 29, 2020 at 15:52 UTC ac8a88d054e38f396a781cd938d724b074d6312b
1 file changed +5 -1
core/node/libp2p/pubsub.go
+5 -1
@@ -17,6 +17,10 @@ func FloodSub(pubsubOptions ...pubsub.Option) interface{} {
17
18 func GossipSub(pubsubOptions ...pubsub.Option) interface{} {
19 return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host, disc discovery.Discovery) (service *pubsub.PubSub, err error) {
20 - return pubsub.NewGossipSub(helpers.LifecycleCtx(mctx, lc), host, append(pubsubOptions, pubsub.WithDiscovery(disc))...)
20 + return pubsub.NewGossipSub(helpers.LifecycleCtx(mctx, lc), host, append(
21 + pubsubOptions,
22 + pubsub.WithDiscovery(disc),
23 + pubsub.WithFloodPublish(true))...,
24 + )
25 }
26 }