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

lightningnetwork / lnd / 14000719599

21 Mar 2025 08:54PM UTC coverage: 58.717% (-10.3%) from 68.989%
14000719599

Pull #8754

github

web-flow
Merge 29f363f18 into 5235f3b24
Pull Request #8754: Add `Outbound` Remote Signer implementation

1562 of 2088 new or added lines in 41 files covered. (74.81%)

28126 existing lines in 464 files now uncovered.

97953 of 166822 relevant lines covered (58.72%)

1.82 hits per line

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

78.95
/lnwallet/rpcwallet/remote_signer_connection_builder.go
1
package rpcwallet
2

3
import (
4
        "context"
5
        "errors"
6

7
        "github.com/lightningnetwork/lnd/lncfg"
8
)
9

10
// RemoteSignerConnectionBuilder creates instances of the RemoteSignerConnection
11
// interface, based on the provided configuration.
12
type RemoteSignerConnectionBuilder struct {
13
        cfg *lncfg.RemoteSigner
14
}
15

16
// NewRemoteSignerConnectionBuilder creates a new instance of the
17
// RemoteSignerBuilder.
18
func NewRemoteSignerConnectionBuilder(
19
        cfg *lncfg.RemoteSigner) *RemoteSignerConnectionBuilder {
3✔
20

3✔
21
        return &RemoteSignerConnectionBuilder{cfg}
3✔
22
}
3✔
23

24
// Build creates a new RemoteSignerConnection instance. If the configuration
25
// specifies that an inbound remote signer should be used, a new
26
// OutboundConnection is created. If the configuration specifies that an
27
// outbound remote signer should be used, a new InboundConnection is created.
28
// The function returns the created RemoteSignerConnection instance, and a
29
// cleanup function that should be called when the RemoteSignerConnection is no
30
// longer needed.
31
func (b *RemoteSignerConnectionBuilder) Build(
32
        ctx context.Context) (RemoteSignerConnection, error) {
3✔
33

3✔
34
        if !b.cfg.Enable {
3✔
NEW
35
                // This should be unreachable, but this is an extra sanity check
×
NEW
36
                return nil, errors.New("remote signer not enabled in " +
×
NEW
37
                        "config")
×
NEW
38
        }
×
39

40
        // Create the remote signer based on the configuration.
41
        if !b.cfg.AllowInboundConnection {
6✔
42
                return NewOutboundConnection(ctx, b.cfg.ConnectionCfg)
3✔
43
        }
3✔
44

45
        inboundConnection := NewInboundConnection(
3✔
46
                b.cfg.RequestTimeout, b.cfg.Timeout,
3✔
47
        )
3✔
48

3✔
49
        return inboundConnection, nil
3✔
50
}
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