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

lightningnetwork / lnd / 16034782542

02 Jul 2025 08:10PM UTC coverage: 57.802% (-9.8%) from 67.589%
16034782542

Pull #10001

github

web-flow
Merge 30348038e into 8a0341419
Pull Request #10001: Enable quiescence in production and add timeout config

5 of 8 new or added lines in 4 files covered. (62.5%)

28413 existing lines in 456 files now uncovered.

98494 of 170400 relevant lines covered (57.8%)

1.79 hits per line

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

35.71
/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.
32
func (h *Htlcswitch) Validate() error {
3✔
33
        if h.MailboxDeliveryTimeout <= 0 {
3✔
34
                return fmt.Errorf("mailboxdeliverytimeout must be positive")
×
35
        }
×
36

37
        if h.MailboxDeliveryTimeout > MaxMailboxDeliveryTimeout {
3✔
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.
45
        if !IsDevBuild() && h.QuiescenceTimeout < minQuiescenceTimeout {
3✔
NEW
46
                return fmt.Errorf("quiescencetimeout: %v below minimal: %v",
×
NEW
47
                        h.QuiescenceTimeout, minQuiescenceTimeout)
×
NEW
48
        }
×
49

50
        return nil
3✔
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