Browse Source

lncfg: expose channel update rate limiting options

master
Wilmer Paulino 3 years ago
parent
commit
dcac5a87f4
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F
  1. 5
      config.go
  2. 6
      lncfg/gossip.go
  3. 5
      sample-lnd.conf
  4. 2
      server.go

5
config.go

@ -488,7 +488,10 @@ func DefaultConfig() Config {
Backoff: defaultTLSBackoff,
},
},
Gossip: &lncfg.Gossip{},
Gossip: &lncfg.Gossip{
MaxChannelUpdateBurst: discovery.DefaultMaxChannelUpdateBurst,
ChannelUpdateInterval: discovery.DefaultChannelUpdateInterval,
},
MaxOutgoingCltvExpiry: htlcswitch.DefaultMaxOutgoingCltvExpiry,
MaxChannelFeeAllocation: htlcswitch.DefaultMaxLinkFeeAllocation,
MaxCommitFeeRateAnchors: lnwallet.DefaultAnchorsCommitMaxFeeRateSatPerVByte,

6
lncfg/gossip.go

@ -1,6 +1,8 @@
package lncfg
import (
"time"
"github.com/lightningnetwork/lnd/discovery"
"github.com/lightningnetwork/lnd/routing/route"
)
@ -9,6 +11,10 @@ type Gossip struct {
PinnedSyncersRaw []string `long:"pinned-syncers" description:"A set of peers that should always remain in an active sync state, which can be used to closely synchronize the routing tables of two nodes. The value should be comma separated list of hex-encoded pubkeys. Connected peers matching this pubkey will remain active for the duration of the connection and not count towards the NumActiveSyncer count."`
PinnedSyncers discovery.PinnedSyncers
MaxChannelUpdateBurst int `long:"max-channel-update-burst" description:"The maximum number of updates for a specific channel and direction that lnd will accept over the channel update interval."`
ChannelUpdateInterval time.Duration `long:"channel-update-interval" description:"The interval used to determine how often lnd should allow a burst of new updates for a specific channel and direction."`
}
// Parse the pubkeys for the pinned syncers.

5
sample-lnd.conf

@ -1043,3 +1043,8 @@ litecoin.node=ltcd
; peers can be specified by setting multiple flags/fields in the config.
; gossip.pinned-syncers=pubkey1
; gossip.pinned-syncers=pubkey2
; The maximum number of updates for a specific channel and direction that lnd
; will accept over the channel update interval.
; gossip.max-channel-update-burst=10
; gossip.channel-update-interval=1m

2
server.go

@ -823,6 +823,8 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
SubBatchDelay: time.Second * 5,
IgnoreHistoricalFilters: cfg.IgnoreHistoricalGossipFilters,
PinnedSyncers: cfg.Gossip.PinnedSyncers,
MaxChannelUpdateBurst: cfg.Gossip.MaxChannelUpdateBurst,
ChannelUpdateInterval: cfg.Gossip.ChannelUpdateInterval,
},
nodeKeyECDH.PubKey(),
)

Loading…
Cancel
Save