• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13974489001

20 Mar 2025 04:32PM UTC coverage: 56.292% (-2.9%) from 59.168%
13974489001

Pull #8754

github

web-flow
Merge aed149e6b into ea050d06f
Pull Request #8754: Add `Outbound` Remote Signer implementation

594 of 1713 new or added lines in 26 files covered. (34.68%)

23052 existing lines in 272 files now uncovered.

105921 of 188165 relevant lines covered (56.29%)

23796.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lncfg/gossip.go
1
package lncfg
2

3
import (
4
        "fmt"
5
        "time"
6

7
        "github.com/lightningnetwork/lnd/discovery"
8
        "github.com/lightningnetwork/lnd/routing/route"
9
)
10

11
// minAnnouncementConf defines the minimal num of confs needed for the config
12
// AnnouncementConf. We choose 3 here as it's unlikely a reorg depth of 3 would
13
// happen.
14
//
15
// NOTE: The specs recommends setting this value to 6, which is the default
16
// value used for AnnouncementConf. However the receiver should be able to
17
// decide which channels to be included in its local graph, more details can be
18
// found:
19
// - https://github.com/lightning/bolts/pull/1215#issuecomment-2557337202
20
const minAnnouncementConf = 3
21

22
//nolint:ll
23
type Gossip struct {
24
        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."`
25

26
        PinnedSyncers discovery.PinnedSyncers
27

28
        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."`
29

30
        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."`
31

32
        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."`
33

34
        AnnouncementConf uint32 `long:"announcement-conf" description:"The number of confirmations required before processing channel announcements."`
35
}
36

37
// Parse the pubkeys for the pinned syncers.
UNCOV
38
func (g *Gossip) Parse() error {
×
UNCOV
39
        pinnedSyncers := make(discovery.PinnedSyncers)
×
UNCOV
40
        for _, pubkeyStr := range g.PinnedSyncersRaw {
×
UNCOV
41
                vertex, err := route.NewVertexFromStr(pubkeyStr)
×
UNCOV
42
                if err != nil {
×
43
                        return err
×
44
                }
×
UNCOV
45
                pinnedSyncers[vertex] = struct{}{}
×
46
        }
47

UNCOV
48
        g.PinnedSyncers = pinnedSyncers
×
UNCOV
49

×
UNCOV
50
        return nil
×
51
}
52

53
// Validate checks the Gossip configuration to ensure that the input values are
54
// sane.
UNCOV
55
func (g *Gossip) Validate() error {
×
UNCOV
56
        if g.AnnouncementConf < minAnnouncementConf {
×
57
                return fmt.Errorf("announcement-conf=%v must be no less than "+
×
58
                        "%v", g.AnnouncementConf, minAnnouncementConf)
×
59
        }
×
60

UNCOV
61
        return nil
×
62
}
63

64
// Compile-time constraint to ensure Gossip implements the Validator interface.
65
var _ Validator = (*Gossip)(nil)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc