mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-08 08:53:12 +00:00
fix: code review
This commit is contained in:
parent
d241dad546
commit
4e7909b38b
@ -73,7 +73,7 @@ func rlnFlags() []cli.Flag {
|
||||
Value: &options.RLNRelay.MembershipContractAddress,
|
||||
},
|
||||
},
|
||||
&cli.IntFlag{
|
||||
&cli.Int64Flag{
|
||||
Name: "rln-relay-bandwidth-threshold",
|
||||
Value: 0,
|
||||
Usage: "Message rate in bytes/sec after which verification of proofs should happen. Use 0 to disable bandwidth rate limits",
|
||||
|
||||
@ -44,7 +44,7 @@ type RLNRelayOptions struct {
|
||||
ETHPrivateKey *ecdsa.PrivateKey
|
||||
ETHClientAddress string
|
||||
MembershipContractAddress common.Address
|
||||
BandwidthThreshold int
|
||||
BandwidthThreshold int64
|
||||
}
|
||||
|
||||
// FilterOptions are settings used to enable filter protocol. This is a protocol
|
||||
|
||||
@ -76,7 +76,7 @@ func (w *WakuNode) mountRlnRelay(ctx context.Context) error {
|
||||
|
||||
var limiter *rate.Limiter
|
||||
if w.opts.rlnRelayBandwidthThreshold != 0 {
|
||||
limiter = rate.NewLimiter(rate.Limit(w.opts.rlnRelayBandwidthThreshold), w.opts.rlnRelayBandwidthThreshold)
|
||||
limiter = rate.NewLimiter(rate.Limit(w.opts.rlnRelayBandwidthThreshold), int(w.opts.rlnRelayBandwidthThreshold))
|
||||
}
|
||||
|
||||
rlnRelay, err := rln.New(w.Relay(), groupManager, w.opts.rlnRelayPubsubTopic, w.opts.rlnRelayContentTopic, w.opts.rlnSpamHandler, limiter, w.timesource, w.log)
|
||||
|
||||
@ -106,7 +106,7 @@ type WakuNodeParameters struct {
|
||||
keystorePassword string
|
||||
rlnMembershipContractAddress common.Address
|
||||
rlnRegistrationHandler func(tx *types.Transaction)
|
||||
rlnRelayBandwidthThreshold int
|
||||
rlnRelayBandwidthThreshold int64
|
||||
|
||||
keepAliveInterval time.Duration
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// WithRLNBandwidthThreshold sets the message rate in bytes/sec after which verification of proofs should happen
|
||||
func WithRLNBandwidthThreshold(rateLimit int) WakuNodeOption {
|
||||
func WithRLNBandwidthThreshold(rateLimit int64) WakuNodeOption {
|
||||
return func(params *WakuNodeParameters) error {
|
||||
params.rlnRelayBandwidthThreshold = rateLimit
|
||||
return nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user