Skip to content

Commit

Permalink
refactoring(share/p2p): remove TTL in pubsub (#2023)
Browse files Browse the repository at this point in the history
Return TTL back to the default value to avoid message duplication with
the same msgID.

Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
  • Loading branch information
vgonkivs and Wondertan authored Apr 11, 2023
1 parent 9c0a5fb commit d9615f0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions share/p2p/shrexsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ type PubSub struct {

// NewPubSub creates a libp2p.PubSub wrapper.
func NewPubSub(ctx context.Context, h host.Host, networkID string) (*PubSub, error) {
// WithSeenMessagesTTL without duration allows to process all incoming messages(even with the same
// msgId)
pubsub, err := pubsub.NewFloodSub(ctx, h, pubsub.WithSeenMessagesTTL(0))
pubsub, err := pubsub.NewFloodSub(ctx, h)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d9615f0

Please sign in to comment.