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

lightningnetwork / lnd / 11216766535

07 Oct 2024 01:37PM UTC coverage: 57.817% (-1.0%) from 58.817%
11216766535

Pull #9148

github

ProofOfKeags
lnwire: remove kickoff feerate from propose/commit
Pull Request #9148: DynComms [2/n]: lnwire: add authenticated wire messages for Dyn*

571 of 879 new or added lines in 16 files covered. (64.96%)

23253 existing lines in 251 files now uncovered.

99022 of 171268 relevant lines covered (57.82%)

38420.67 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:lll
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