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

lightningnetwork / lnd / 12414491588

19 Dec 2024 02:18PM UTC coverage: 57.468% (+8.1%) from 49.414%
12414491588

Pull #8777

github

ziggie1984
funding: refactor gossip msg code

We almost never need to create all messages at the same time
(ChanUpdate,ChanAnnouncement,Proof) so we split it up into own
functions.
Pull Request #8777: multi: make reassignment of alias channel edge atomic

129 of 274 new or added lines in 7 files covered. (47.08%)

19694 existing lines in 247 files now uncovered.

102586 of 178511 relevant lines covered (57.47%)

24598.76 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.
UNCOV
27
func (r *RemoteSigner) Validate() error {
×
UNCOV
28
        if !r.Enable {
×
UNCOV
29
                return nil
×
UNCOV
30
        }
×
31

UNCOV
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

UNCOV
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

UNCOV
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