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

lightningnetwork / lnd / 12986279612

27 Jan 2025 09:51AM UTC coverage: 57.652% (-1.1%) from 58.788%
12986279612

Pull #9447

github

yyforyongyu
sweep: rename methods for clarity

We now rename "third party" to "unknown" as the inputs can be spent via
an older sweeping tx, a third party (anchor), or a remote party (pin).
In fee bumper we don't have the info to distinguish the above cases, and
leave them to be further handled by the sweeper as it has more context.
Pull Request #9447: sweep: start tracking input spending status in the fee bumper

83 of 87 new or added lines in 2 files covered. (95.4%)

19578 existing lines in 256 files now uncovered.

103448 of 179434 relevant lines covered (57.65%)

24884.58 hits per line

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

0.0
/lncfg/routing.go
1
package lncfg
2

3
import "fmt"
4

5
// Routing holds the configuration options for routing.
6
//
7
//nolint:ll
8
type Routing struct {
9
        AssumeChannelValid bool `long:"assumechanvalid" description:"DEPRECATED: Skip checking channel spentness during graph validation. This speedup comes at the risk of using an unvalidated view of the network for routing. (default: false)" hidden:"true"`
10

11
        StrictZombiePruning bool `long:"strictgraphpruning" description:"If true, then the graph will be pruned more aggressively for zombies. In practice this means that edges with a single stale edge will be considered a zombie."`
12

13
        BlindedPaths BlindedPaths `group:"blinding" namespace:"blinding"`
14
}
15

16
// BlindedPaths holds the configuration options for blinded path construction.
17
//
18
//nolint:ll
19
type BlindedPaths struct {
20
        MinNumRealHops           uint8   `long:"min-num-real-hops" description:"The minimum number of real hops to include in a blinded path. This doesn't include our node, so if the minimum is 1, then the path will contain at minimum our node along with an introduction node hop. If it is zero then the shortest path will use our node as an introduction node."`
21
        NumHops                  uint8   `long:"num-hops" description:"The number of hops to include in a blinded path. This doesn't include our node, so if it is 1, then the path will contain our node along with an introduction node or dummy node hop. If paths shorter than NumHops is found, then they will be padded using dummy hops."`
22
        MaxNumPaths              uint8   `long:"max-num-paths" description:"The maximum number of blinded paths to select and add to an invoice."`
23
        PolicyIncreaseMultiplier float64 `long:"policy-increase-multiplier" description:"The amount by which to increase certain policy values of hops on a blinded path in order to add a probing buffer."`
24
        PolicyDecreaseMultiplier float64 `long:"policy-decrease-multiplier" description:"The amount by which to decrease certain policy values of hops on a blinded path in order to add a probing buffer."`
25
}
26

27
// Validate checks that the various routing config options are sane.
28
//
29
// NOTE: this is part of the Validator interface.
UNCOV
30
func (r *Routing) Validate() error {
×
UNCOV
31
        if r.BlindedPaths.MinNumRealHops > r.BlindedPaths.NumHops {
×
32
                return fmt.Errorf("the minimum number of real hops in a " +
×
33
                        "blinded path must be smaller than or equal to the " +
×
34
                        "number of hops expected to be included in each path")
×
35
        }
×
36

UNCOV
37
        if r.BlindedPaths.PolicyIncreaseMultiplier < 1 {
×
38
                return fmt.Errorf("the blinded route policy increase " +
×
39
                        "multiplier must be greater than or equal to 1")
×
40
        }
×
41

UNCOV
42
        if r.BlindedPaths.PolicyDecreaseMultiplier > 1 ||
×
UNCOV
43
                r.BlindedPaths.PolicyDecreaseMultiplier < 0 {
×
44

×
45
                return fmt.Errorf("the blinded route policy decrease " +
×
46
                        "multiplier must be in the range (0,1]")
×
47
        }
×
48

UNCOV
49
        return nil
×
50
}
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