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

lightningnetwork / lnd / 12693319945

09 Jan 2025 03:39PM UTC coverage: 58.702% (+0.1%) from 58.598%
12693319945

Pull #9405

github

yyforyongyu
multi: make `ProofMatureDelta` configurable

We add a new config option to set the `ProofMatureDelta` so the users
can tune their graphs based on their own perference over the num of
confs found in the announcement signatures.
Pull Request #9405: discovery+lnd: make param `ProofMatureDelta` configurable

13 of 16 new or added lines in 3 files covered. (81.25%)

28 existing lines in 10 files now uncovered.

135233 of 230371 relevant lines covered (58.7%)

19189.88 hits per line

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

70.59
/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
//nolint:ll
12
type Gossip struct {
13
        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."`
14

15
        PinnedSyncers discovery.PinnedSyncers
16

17
        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."`
18

19
        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."`
20

21
        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."`
22

23
        AnnouncementConf uint32 `long:"announcement-conf" description:"The number of confirmations required before processing channel announcements."`
24
}
25

26
// Parse the pubkeys for the pinned syncers.
27
func (g *Gossip) Parse() error {
3✔
28
        pinnedSyncers := make(discovery.PinnedSyncers)
3✔
29
        for _, pubkeyStr := range g.PinnedSyncersRaw {
6✔
30
                vertex, err := route.NewVertexFromStr(pubkeyStr)
3✔
31
                if err != nil {
3✔
32
                        return err
×
33
                }
×
34
                pinnedSyncers[vertex] = struct{}{}
3✔
35
        }
36

37
        g.PinnedSyncers = pinnedSyncers
3✔
38

3✔
39
        return nil
3✔
40
}
41

42
// Validate checks the Gossip configuration to ensure that the input values are
43
// sane.
44
func (g *Gossip) Validate() error {
3✔
45
        if g.AnnouncementConf <= 3 {
3✔
NEW
46
                return fmt.Errorf("announcement-conf=%v must be no less than 3",
×
NEW
47
                        g.AnnouncementConf)
×
NEW
48
        }
×
49

50
        return nil
3✔
51
}
52

53
// Compile-time constraint to ensure Gossip implements the Validator interface.
54
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