From 12a1daae745c177b35f5fade237717980b10e094 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Fri, 5 Nov 2021 10:38:35 -0400 Subject: [PATCH] fix: remove useless parameter --- waku/node.go | 2 +- waku/v2/node/wakuoptions.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/waku/node.go b/waku/node.go index 4b43b286..f5cee94d 100644 --- a/waku/node.go +++ b/waku/node.go @@ -145,7 +145,7 @@ func Execute(options Options) { if options.Store.Enable { maxDays := time.Hour * 24 * time.Duration(options.Store.RetentionMaxDays) - nodeOpts = append(nodeOpts, node.WithWakuStoreAndLimits(true, options.Store.ShouldResume, maxDays, options.Store.RetentionMaxMessages)) + nodeOpts = append(nodeOpts, node.WithWakuStoreAndLimits(options.Store.ShouldResume, maxDays, options.Store.RetentionMaxMessages)) if options.UseDB { dbStore, err := persistence.NewDBStore(persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, maxDays)) failOnErr(err, "DBStore") diff --git a/waku/v2/node/wakuoptions.go b/waku/v2/node/wakuoptions.go index c65e60e5..b1548e9e 100644 --- a/waku/v2/node/wakuoptions.go +++ b/waku/v2/node/wakuoptions.go @@ -179,10 +179,12 @@ func WithWakuStore(shouldStoreMessages bool, shouldResume bool) WakuNodeOption { } } -func WithWakuStoreAndLimits(shouldStoreMessages bool, shouldResume bool, maxDays time.Duration, maxMessages int) WakuNodeOption { +// WithWakuStoreAndLimits enables the Waku V2 Store protocol, storing them in an optional message provider +// applying an specific retention policy +func WithWakuStoreAndLimits(shouldResume bool, maxDays time.Duration, maxMessages int) WakuNodeOption { return func(params *WakuNodeParameters) error { params.enableStore = true - params.storeMsgs = shouldStoreMessages + params.storeMsgs = true params.shouldResume = shouldResume params.maxDays = maxDays params.maxMessages = maxMessages