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

lightningnetwork / lnd / 12986279612

27 Jan 2025 09:51AM UTC coverage: 57.652% (-1.1%) from 58.788%
12986279612

Pull #9447

github

yyforyongyu
sweep: rename methods for clarity

We now rename "third party" to "unknown" as the inputs can be spent via
an older sweeping tx, a third party (anchor), or a remote party (pin).
In fee bumper we don't have the info to distinguish the above cases, and
leave them to be further handled by the sweeper as it has more context.
Pull Request #9447: sweep: start tracking input spending status in the fee bumper

83 of 87 new or added lines in 2 files covered. (95.4%)

19578 existing lines in 256 files now uncovered.

103448 of 179434 relevant lines covered (57.65%)

24884.58 hits per line

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

85.71
/lnutils/log.go
1
package lnutils
2

3
import (
4
        "strings"
5

6
        "github.com/davecgh/go-spew/spew"
7
)
8

9
// LogClosure is used to provide a closure over expensive logging operations so
10
// don't have to be performed when the logging level doesn't warrant it.
11
type LogClosure func() string
12

13
// String invokes the underlying function and returns the result.
14
func (c LogClosure) String() string {
4✔
15
        return c()
4✔
16
}
4✔
17

18
// NewLogClosure returns a new closure over a function that returns a string
19
// which itself provides a Stringer interface so that it can be used with the
20
// logging system.
21
func NewLogClosure(c func() string) LogClosure {
2,667✔
22
        return LogClosure(c)
2,667✔
23
}
2,667✔
24

25
// SpewLogClosure takes an interface and returns the string of it created from
26
// `spew.Sdump` in a LogClosure.
27
func SpewLogClosure(a any) LogClosure {
9,076✔
28
        return func() string {
9,080✔
29
                return spew.Sdump(a)
4✔
30
        }
4✔
31
}
32

33
// NewSeparatorClosure returns a new closure that logs a separator line.
34
func NewSeparatorClosure() LogClosure {
1✔
35
        return func() string {
1✔
UNCOV
36
                return strings.Repeat("=", 80)
×
UNCOV
37
        }
×
38
}
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