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

lightningnetwork / lnd / 14358372723

09 Apr 2025 01:26PM UTC coverage: 56.696% (-12.3%) from 69.037%
14358372723

Pull #9696

github

web-flow
Merge e2837e400 into 867d27d68
Pull Request #9696: Add `development_guidelines.md` for both human and machine

107055 of 188823 relevant lines covered (56.7%)

22721.56 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