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

lightningnetwork / lnd / 13536249039

26 Feb 2025 03:42AM UTC coverage: 57.462% (-1.4%) from 58.835%
13536249039

Pull #8453

github

Roasbeef
peer: update chooseDeliveryScript to gen script if needed

In this commit, we update `chooseDeliveryScript` to generate a new
script if needed. This allows us to fold in a few other lines that
always followed this function into this expanded function.

The tests have been updated accordingly.
Pull Request #8453: [4/4] - multi: integrate new rbf coop close FSM into the existing peer flow

275 of 1318 new or added lines in 22 files covered. (20.86%)

19521 existing lines in 257 files now uncovered.

103858 of 180741 relevant lines covered (57.46%)

24750.23 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