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

lightningnetwork / lnd / 13536249039

26 Feb 2025 03:42AM UTC coverage: 57.462% (-1.4%) from 58.835%
13536249039

Pull #8453

github

Roasbeef
peer: update chooseDeliveryScript to gen script if needed

In this commit, we update `chooseDeliveryScript` to generate a new
script if needed. This allows us to fold in a few other lines that
always followed this function into this expanded function.

The tests have been updated accordingly.
Pull Request #8453: [4/4] - multi: integrate new rbf coop close FSM into the existing peer flow

275 of 1318 new or added lines in 22 files covered. (20.86%)

19521 existing lines in 257 files now uncovered.

103858 of 180741 relevant lines covered (57.46%)

24750.23 hits per line

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

0.0
/lncfg/pprof.go
1
package lncfg
2

3
import (
4
        "net"
5
        "strconv"
6
)
7

8
// Pprof holds the configuration options for LND's built-in pprof server.
9
//
10
//nolint:ll
11
type Pprof struct {
12
        CPUProfile string `long:"cpuprofile" description:"Write CPU profile to the specified file"`
13

14
        Profile string `long:"profile" description:"Enable HTTP profiling on either a port or host:port"`
15

16
        BlockingProfile int `long:"blockingprofile" description:"Used to enable a blocking profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every blocking event, and 0 including no events."`
17

18
        MutexProfile int `long:"mutexprofile" description:"Used to Enable a mutex profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every mutex event, and 0 including no events."`
19
}
20

21
// Validate checks the values configured for the profiler.
UNCOV
22
func (p *Pprof) Validate() error {
×
UNCOV
23
        if p.BlockingProfile > 0 {
×
24
                log.Warn("Blocking profile enabled only useful for " +
×
25
                        "debugging because of significant performance impact")
×
26
        }
×
27

UNCOV
28
        if p.MutexProfile > 0 {
×
29
                log.Warn("Mutex profile enabled only useful for " +
×
30
                        "debugging because of significant performance impact")
×
31
        }
×
32

UNCOV
33
        if p.CPUProfile != "" {
×
34
                log.Warn("CPU profile enabled only useful for " +
×
35
                        "debugging because of significant performance impact")
×
36
        }
×
37

UNCOV
38
        if p.Profile != "" {
×
39
                str := "%v: The profile port must be between 1024 and 65535"
×
40

×
41
                // Try to parse Profile as a host:port.
×
42
                _, hostPort, err := net.SplitHostPort(p.Profile)
×
43
                if err == nil {
×
44
                        // Determine if the port is valid.
×
45
                        profilePort, err := strconv.Atoi(hostPort)
×
46

×
47
                        if err != nil || profilePort < 1024 ||
×
48
                                profilePort > 65535 {
×
49

×
50
                                return &UsageError{Err: mkErr(str, hostPort)}
×
51
                        }
×
52
                } else {
×
53
                        // Try to parse Profile as a port.
×
54
                        profilePort, err := strconv.Atoi(p.Profile)
×
55
                        if err != nil || profilePort < 1024 ||
×
56
                                profilePort > 65535 {
×
57

×
58
                                return &UsageError{Err: mkErr(str, p.Profile)}
×
59
                        }
×
60

61
                        // Since the user just set a port, we will serve
62
                        // debugging information over localhost.
63
                        p.Profile = net.JoinHostPort("127.0.0.1", p.Profile)
×
64
                }
65
        }
66

UNCOV
67
        return nil
×
68
}
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