multi: add new config peer-msg-rate-bytes

This commit is contained in:
yyforyongyu committed 2025-09-02 21:23:07 +08:00
1 parent 778456769a
commit 5bc4666efc
6 files changed
+28

No files matched your search

+5
View File
@@ -407,6 +407,10 @@ type Config struct {
// BanThreshold is the score used to decide whether a given peer is
// banned or not.
BanThreshold uint64
// PeerMsgRateBytes is the rate limit for the number of bytes per second
// that we'll allocate to outbound gossip messages for a single peer.
PeerMsgRateBytes uint64
}
// processedNetworkMsg is a wrapper around networkMsg and a boolean. It is
@@ -609,6 +613,7 @@ func New(cfg Config, selfKeyDesc *keychain.KeyDescriptor) *AuthenticatedGossiper
AllotedMsgBytesPerSecond: cfg.MsgRateBytes,
AllotedMsgBytesBurst: cfg.MsgBurstBytes,
FilterConcurrency: cfg.FilterConcurrency,
PeerMsgBytesPerSecond: cfg.PeerMsgRateBytes,
})
gossiper.reliableSender = newReliableSender(&reliableSenderCfg{