mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-02 23:15:36 +02:00
config: expose gossip.pinned-syncers for conf
The pinned syncer set is exposed as a comma-separated list of pubkeys.
This commit is contained in:
28
lncfg/gossip.go
Normal file
28
lncfg/gossip.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package lncfg
|
||||
|
||||
import (
|
||||
"github.com/lightningnetwork/lnd/discovery"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
Reference in New Issue
Block a user