From 074f77ffa0cdd7ac4a404b0da65988e550e04b85 Mon Sep 17 00:00:00 2001 From: rene <41963722+renaynay@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:06:02 +0200 Subject: [PATCH] feat(p2p): add subscriber params override opt --- p2p/subscriber.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/p2p/subscriber.go b/p2p/subscriber.go index ab1fb6ca..a5cc6e45 100644 --- a/p2p/subscriber.go +++ b/p2p/subscriber.go @@ -45,6 +45,13 @@ func WithSubscriberNetworkID(networkID string) SubscriberOption { } } +// WithSubscriberParams is a functional option that overrides SubscriberParams. +func WithSubscriberParams(params SubscriberParams) SubscriberOption { + return func(p *SubscriberParams) { + *p = params + } +} + // NewSubscriber returns a Subscriber that manages the header Module's // relationship with the "header-sub" gossipsub topic. func NewSubscriber[H header.Header[H]](