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

lightningnetwork / lnd / 12284350326

11 Dec 2024 08:27PM UTC coverage: 57.485% (+7.9%) from 49.54%
12284350326

Pull #9348

github

ziggie1984
github: update goveralls tool
Pull Request #9348: github: update goveralls tool

101901 of 177264 relevant lines covered (57.49%)

24841.21 hits per line

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

0.0
/lncfg/remotesigner.go
1
package lncfg
2

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

8
const (
9
        // DefaultRemoteSignerRPCTimeout is the default timeout that is used
10
        // when forwarding a request to the remote signer through RPC.
11
        DefaultRemoteSignerRPCTimeout = 5 * time.Second
12
)
13

14
// RemoteSigner holds the configuration options for a remote RPC signer.
15
//
16
//nolint:ll
17
type RemoteSigner struct {
18
        Enable           bool          `long:"enable" description:"Use a remote signer for signing any on-chain related transactions or messages. Only recommended if local wallet is initialized as watch-only. Remote signer must use the same seed/root key as the local watch-only wallet but must have private keys."`
19
        RPCHost          string        `long:"rpchost" description:"The remote signer's RPC host:port"`
20
        MacaroonPath     string        `long:"macaroonpath" description:"The macaroon to use for authenticating with the remote signer"`
21
        TLSCertPath      string        `long:"tlscertpath" description:"The TLS certificate to use for establishing the remote signer's identity"`
22
        Timeout          time.Duration `long:"timeout" description:"The timeout for connecting to and signing requests with the remote signer. Valid time units are {s, m, h}."`
23
        MigrateWatchOnly bool          `long:"migrate-wallet-to-watch-only" description:"If a wallet with private key material already exists, migrate it into a watch-only wallet on first startup. WARNING: This cannot be undone! Make sure you have backed up your seed before you use this flag! All private keys will be purged from the wallet after first unlock with this flag!"`
24
}
25

26
// Validate checks the values configured for our remote RPC signer.
27
func (r *RemoteSigner) Validate() error {
×
28
        if !r.Enable {
×
29
                return nil
×
30
        }
×
31

32
        if r.Timeout < time.Millisecond {
×
33
                return fmt.Errorf("remote signer: timeout of %v is invalid, "+
×
34
                        "cannot be smaller than %v", r.Timeout,
×
35
                        time.Millisecond)
×
36
        }
×
37

38
        if r.MigrateWatchOnly && !r.Enable {
×
39
                return fmt.Errorf("remote signer: cannot turn on wallet " +
×
40
                        "migration to watch-only if remote signing is not " +
×
41
                        "enabled")
×
42
        }
×
43

44
        return nil
×
45
}
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