mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
multi: add new config options to tune gossip msg allocated bandwidth
We go with the defaults of if no values are set.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/lightningnetwork/lnd/discovery"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
)
|
||||
|
||||
@@ -32,6 +33,10 @@ type Gossip struct {
|
||||
SubBatchDelay time.Duration `long:"sub-batch-delay" description:"The duration to wait before sending the next announcement batch if there are multiple. Use a small value if there are a lot announcements and they need to be broadcast quickly."`
|
||||
|
||||
AnnouncementConf uint32 `long:"announcement-conf" description:"The number of confirmations required before processing channel announcements."`
|
||||
|
||||
MsgRateBytes uint64 `long:"msg-rate-bytes" description:"The maximum number of bytes of gossip messages that will be sent per second. This is a global limit that applies to all peers."`
|
||||
|
||||
MsgBurstBytes uint64 `long:"msg-burst-bytes" description:"The maximum number of bytes of gossip messages that will be sent in a burst. This is a global limit that applies to all peers. This value should be set to something greater than 130 KB"`
|
||||
}
|
||||
|
||||
// Parse the pubkeys for the pinned syncers.
|
||||
@@ -58,6 +63,11 @@ func (g *Gossip) Validate() error {
|
||||
"%v", g.AnnouncementConf, minAnnouncementConf)
|
||||
}
|
||||
|
||||
if g.MsgBurstBytes < lnwire.MaxSliceLength {
|
||||
return fmt.Errorf("msg-burst-bytes=%v must be at least %v",
|
||||
g.MsgBurstBytes, lnwire.MaxSliceLength)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user