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

+6
View File
@@ -146,6 +146,11 @@ type SyncManagerCfg struct {
// FilterConcurrency is the maximum number of concurrent gossip filter
// applications that can be processed. If not set, defaults to 5.
FilterConcurrency int
// PeerMsgBytesPerSecond is the allotted bandwidth rate, expressed in
// bytes/second that a single gossip syncer can consume. Once we exceed
// this rate, message sending will block until we're below the rate.
PeerMsgBytesPerSecond uint64
}
// SyncManager is a subsystem of the gossiper that manages the gossip syncers
@@ -674,6 +679,7 @@ func (m *SyncManager) createGossipSyncer(peer lnpeer.Peer) *GossipSyncer {
maxQueryChanRangeReplies: maxQueryChanRangeReplies,
noTimestampQueryOption: m.cfg.NoTimestampQueries,
isStillZombieChannel: m.cfg.IsStillZombieChannel,
msgBytesPerSecond: m.cfg.PeerMsgBytesPerSecond,
}, m.gossipFilterSema)
// Gossip syncers are initialized by default in a PassiveSync type