• 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

45.45
/lncfg/rpcmiddleware.go
1
package lncfg
2

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

8
const (
9
        // defaultRPCMiddlewareTimeout is the time after which a request sent to
10
        // a gRPC interception middleware times out. This value is chosen very
11
        // low since in a worst case scenario that time is added to a request's
12
        // full duration twice (request and response interception) if a
13
        // middleware is very slow.
14
        defaultRPCMiddlewareTimeout = 2 * time.Second
15
)
16

17
// RPCMiddleware holds the configuration for RPC interception middleware.
18
//
19
//nolint:ll
20
type RPCMiddleware struct {
21
        Enable           bool          `long:"enable" description:"Enable the RPC middleware interceptor functionality."`
22
        InterceptTimeout time.Duration `long:"intercepttimeout" description:"Time after which a RPC middleware intercept request will time out and return an error if it hasn't yet received a response."`
23
        Mandatory        []string      `long:"addmandatory" description:"Add the named middleware to the list of mandatory middlewares. All RPC requests are blocked/denied if any of the mandatory middlewares is not registered. Can be specified multiple times."`
24
}
25

26
// Validate checks the values configured for the RPC middleware.
UNCOV
27
func (r *RPCMiddleware) Validate() error {
×
UNCOV
28
        if r.InterceptTimeout < 0 {
×
29
                return fmt.Errorf("RPC middleware intercept timeout cannot " +
×
30
                        "be negative")
×
31
        }
×
32

UNCOV
33
        return nil
×
34
}
35

36
// DefaultRPCMiddleware returns the default values for the RPC interception
37
// middleware configuration.
38
func DefaultRPCMiddleware() *RPCMiddleware {
1✔
39
        return &RPCMiddleware{
1✔
40
                InterceptTimeout: defaultRPCMiddlewareTimeout,
1✔
41
        }
1✔
42
}
1✔
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