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

lightningnetwork / lnd / 11216766535

07 Oct 2024 01:37PM UTC coverage: 57.817% (-1.0%) from 58.817%
11216766535

Pull #9148

github

ProofOfKeags
lnwire: remove kickoff feerate from propose/commit
Pull Request #9148: DynComms [2/n]: lnwire: add authenticated wire messages for Dyn*

571 of 879 new or added lines in 16 files covered. (64.96%)

23253 existing lines in 251 files now uncovered.

99022 of 171268 relevant lines covered (57.82%)

38420.67 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:lll
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