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

lightningnetwork / lnd / 15736109134

18 Jun 2025 02:46PM UTC coverage: 58.197% (-10.1%) from 68.248%
15736109134

Pull #9752

github

web-flow
Merge d2634a68c into 31c74f20f
Pull Request #9752: routerrpc: reject payment to invoice that don't have payment secret or blinded paths

6 of 13 new or added lines in 2 files covered. (46.15%)

28331 existing lines in 455 files now uncovered.

97860 of 168153 relevant lines covered (58.2%)

1.81 hits per line

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

35.71
/lncfg/workers.go
1
package lncfg
2

3
import "fmt"
4

5
const (
6
        // DefaultReadWorkers is the default maximum number of concurrent
7
        // workers used by the daemon's read pool.
8
        DefaultReadWorkers = 100
9

10
        // DefaultWriteWorkers is the default maximum number of concurrent
11
        // workers used by the daemon's write pool.
12
        DefaultWriteWorkers = 8
13

14
        // DefaultSigWorkers is the default maximum number of concurrent workers
15
        // used by the daemon's sig pool.
16
        DefaultSigWorkers = 8
17
)
18

19
// Workers exposes CLI configuration for turning resources consumed by worker
20
// pools.
21
//
22
//nolint:ll
23
type Workers struct {
24
        // Read is the maximum number of concurrent read pool workers.
25
        Read int `long:"read" description:"Maximum number of concurrent read pool workers. This number should be proportional to the number of peers."`
26

27
        // Write is the maximum number of concurrent write pool workers.
28
        Write int `long:"write" description:"Maximum number of concurrent write pool workers. This number should be proportional to the number of CPUs on the host. "`
29

30
        // Sig is the maximum number of concurrent sig pool workers.
31
        Sig int `long:"sig" description:"Maximum number of concurrent sig pool workers. This number should be proportional to the number of CPUs on the host."`
32
}
33

34
// Validate checks the Workers configuration to ensure that the input values are
35
// sane.
36
func (w *Workers) Validate() error {
3✔
37
        if w.Read <= 0 {
3✔
UNCOV
38
                return fmt.Errorf("number of read workers (%d) must be "+
×
UNCOV
39
                        "positive", w.Read)
×
UNCOV
40
        }
×
41
        if w.Write <= 0 {
3✔
UNCOV
42
                return fmt.Errorf("number of write workers (%d) must be "+
×
UNCOV
43
                        "positive", w.Write)
×
UNCOV
44
        }
×
45
        if w.Sig <= 0 {
3✔
UNCOV
46
                return fmt.Errorf("number of sig workers (%d) must be "+
×
UNCOV
47
                        "positive", w.Sig)
×
UNCOV
48
        }
×
49

50
        return nil
3✔
51
}
52

53
// Compile-time constraint to ensure Workers implements the Validator interface.
54
var _ Validator = (*Workers)(nil)
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