From 0c09163ebf9b7f49753b9d4bd25ebcd22242a198 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 22 Feb 2023 21:35:27 +1300 Subject: [PATCH] circuitv2: add a relay option to disable limits --- p2p/protocol/circuitv2/relay/options.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/p2p/protocol/circuitv2/relay/options.go b/p2p/protocol/circuitv2/relay/options.go index 3464115226..a69b658ec1 100644 --- a/p2p/protocol/circuitv2/relay/options.go +++ b/p2p/protocol/circuitv2/relay/options.go @@ -18,6 +18,14 @@ func WithLimit(limit *RelayLimit) Option { } } +// WithInfiniteLimits is a Relay option that disables limits. +func WithInfiniteLimits() Option { + return func(r *Relay) error { + r.rc.Limit = nil + return nil + } +} + // WithACL is a Relay option that supplies an ACLFilter for access control. func WithACL(acl ACLFilter) Option { return func(r *Relay) error {