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

lightningnetwork / lnd / 16683051882

01 Aug 2025 07:03PM UTC coverage: 54.949% (-12.1%) from 67.047%
16683051882

Pull #9455

github

web-flow
Merge 3f1f50be8 into 37523b6cb
Pull Request #9455: discovery+lnwire: add support for DNS host name in NodeAnnouncement msg

144 of 226 new or added lines in 7 files covered. (63.72%)

23852 existing lines in 290 files now uncovered.

108751 of 197912 relevant lines covered (54.95%)

22080.83 hits per line

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

0.0
/lncfg/htlcswitch.go
1
package lncfg
2

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

8
var (
9
        // MaxMailboxDeliveryTimeout specifies the max allowed timeout value.
10
        // This value is derived from the itest `async_bidirectional_payments`,
11
        // where both side send 483 payments at the same time to stress test
12
        // lnd.
13
        MaxMailboxDeliveryTimeout = 2 * time.Minute
14

15
        // minQuiescenceTimeout specifies the minimal timeout value that can be
16
        // used for `QuiescenceTimeout`.
17
        minQuiescenceTimeout = 30 * time.Second
18

19
        // DefaultQuiescenceTimeout specifies the default value to be used for
20
        // `QuiescenceTimeout`.
21
        DefaultQuiescenceTimeout = 60 * time.Second
22
)
23

24
//nolint:ll
25
type Htlcswitch struct {
26
        MailboxDeliveryTimeout time.Duration `long:"mailboxdeliverytimeout" description:"The timeout value when delivering HTLCs to a channel link. Setting this value too small will result in local payment failures if large number of payments are sent over a short period."`
27

28
        QuiescenceTimeout time.Duration `long:"quiescencetimeout" description:"The max duration that the channel can be quiesced. Any dependent protocols (dynamic commitments, splicing, etc.) must finish their operations under this timeout value, otherwise the node will disconnect."`
29
}
30

31
// Validate checks the values configured for htlcswitch.
UNCOV
32
func (h *Htlcswitch) Validate() error {
×
UNCOV
33
        if h.MailboxDeliveryTimeout <= 0 {
×
34
                return fmt.Errorf("mailboxdeliverytimeout must be positive")
×
35
        }
×
36

UNCOV
37
        if h.MailboxDeliveryTimeout > MaxMailboxDeliveryTimeout {
×
38
                return fmt.Errorf("mailboxdeliverytimeout: %v exceeds "+
×
39
                        "maximum: %v", h.MailboxDeliveryTimeout,
×
40
                        MaxMailboxDeliveryTimeout)
×
41
        }
×
42

43
        // Skip the validation for integration tests so we can use a smaller
44
        // timeout value to check the timeout behavior.
UNCOV
45
        if !IsDevBuild() && h.QuiescenceTimeout < minQuiescenceTimeout {
×
46
                return fmt.Errorf("quiescencetimeout: %v below minimal: %v",
×
47
                        h.QuiescenceTimeout, minQuiescenceTimeout)
×
48
        }
×
49

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