mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
542bbbbc30
The gossip.pinned-syncers flag is declared as a string slice which means it should not be a comma separated list of elements but the flag should be specified multiple times instead.
36 lines
1.4 KiB
Go
36 lines
1.4 KiB
Go
package lncfg
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/lightningnetwork/lnd/discovery"
|
|
"github.com/lightningnetwork/lnd/routing/route"
|
|
)
|
|
|
|
//nolint:lll
|
|
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 a hex-encoded pubkey, the flag can be specified multiple times to add multiple peers. 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.
|
|
func (g *Gossip) Parse() error {
|
|
pinnedSyncers := make(discovery.PinnedSyncers)
|
|
for _, pubkeyStr := range g.PinnedSyncersRaw {
|
|
vertex, err := route.NewVertexFromStr(pubkeyStr)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
pinnedSyncers[vertex] = struct{}{}
|
|
}
|
|
|
|
g.PinnedSyncers = pinnedSyncers
|
|
|
|
return nil
|
|
}
|