• 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/invoices.go
1
package lncfg
2

3
const (
4
        // DefaultHoldInvoiceExpiryDelta defines the number of blocks before the
5
        // expiry height of a hold invoice's htlc that lnd will automatically
6
        // cancel the invoice to prevent the channel from force closing. This
7
        // value *must* be greater than DefaultIncomingBroadcastDelta to prevent
8
        // force closes.
9
        DefaultHoldInvoiceExpiryDelta = DefaultIncomingBroadcastDelta + 2
10

11
        // DefaultMinNumRealBlindedPathHops is the minimum number of _real_
12
        // hops to include in a blinded payment path. This doesn't include our
13
        // node (the destination node), so if the minimum is 1, then the path
14
        // will contain at minimum our node along with an introduction node hop.
15
        DefaultMinNumRealBlindedPathHops = 1
16

17
        // DefaultNumBlindedPathHops is the number of hops to include in a
18
        // blinded payment path. If paths shorter than this number are found,
19
        // then dummy hops are used to pad the path to this length.
20
        DefaultNumBlindedPathHops = 2
21

22
        // DefaultMaxNumBlindedPaths is the maximum number of different blinded
23
        // payment paths to include in an invoice.
24
        DefaultMaxNumBlindedPaths = 3
25

26
        // DefaultBlindedPathPolicyIncreaseMultiplier is the default multiplier
27
        // used to increase certain blinded hop policy values in order to add
28
        // a probing buffer.
29
        DefaultBlindedPathPolicyIncreaseMultiplier = 1.1
30

31
        // DefaultBlindedPathPolicyDecreaseMultiplier is the default multiplier
32
        // used to decrease certain blinded hop policy values in order to add a
33
        // probing buffer.
34
        DefaultBlindedPathPolicyDecreaseMultiplier = 0.9
35
)
36

37
// Invoices holds the configuration options for invoices.
38
//
39
//nolint:ll
40
type Invoices struct {
41
        HoldExpiryDelta uint32 `long:"holdexpirydelta" description:"The number of blocks before a hold invoice's htlc expires that the invoice should be canceled to prevent a force close. Force closes will not be prevented if this value is not greater than DefaultIncomingBroadcastDelta."`
42
}
43

44
// Validate checks that the various invoice config options are sane.
45
//
46
// NOTE: this is part of the Validator interface.
UNCOV
47
func (i *Invoices) Validate() error {
×
UNCOV
48
        // Log a warning if our expiry delta is not greater than our incoming
×
UNCOV
49
        // broadcast delta. We do not fail here because this value may be set
×
UNCOV
50
        // to zero to intentionally keep lnd's behavior unchanged from when we
×
UNCOV
51
        // didn't auto-cancel these invoices.
×
UNCOV
52
        if i.HoldExpiryDelta <= DefaultIncomingBroadcastDelta {
×
53
                log.Warnf("Invoice hold expiry delta: %v <= incoming "+
×
54
                        "delta: %v, accepted hold invoices will force close "+
×
55
                        "channels if they are not canceled manually",
×
56
                        i.HoldExpiryDelta, DefaultIncomingBroadcastDelta)
×
57
        }
×
58

UNCOV
59
        return nil
×
60
}
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