multi: add new config ban-threshold

This commit is contained in:
yyforyongyu committed 2025-08-04 15:45:47 +08:00
1 parent 3109a8f3fe
commit a6f8617e7c
5 files changed
+25 -1

No files matched your search

+5 -1
View File
@@ -403,6 +403,10 @@ type Config struct {
// FilterConcurrency is the maximum number of concurrent gossip filter
// applications that can be processed.
FilterConcurrency int
// BanThreshold is the score used to decide whether a given peer is
// banned or not.
BanThreshold uint64
}
// processedNetworkMsg is a wrapper around networkMsg and a boolean. It is
@@ -586,7 +590,7 @@ func New(cfg Config, selfKeyDesc *keychain.KeyDescriptor) *AuthenticatedGossiper
maxRejectedUpdates,
),
chanUpdateRateLimiter: make(map[uint64][2]*rate.Limiter),
banman: newBanman(DefaultBanThreshold),
banman: newBanman(cfg.BanThreshold),
}
gossiper.vb = NewValidationBarrier(1000, gossiper.quit)