mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
Merge pull request #5689 from guggero/remote-signer
Support remote signing over RPC
This commit is contained in:
23
config.go
23
config.go
@@ -394,6 +394,8 @@ type Config struct {
|
||||
|
||||
RPCMiddleware *lncfg.RPCMiddleware `group:"rpcmiddleware" namespace:"rpcmiddleware"`
|
||||
|
||||
RemoteSigner *lncfg.RemoteSigner `group:"remotesigner" namespace:"remotesigner"`
|
||||
|
||||
// LogWriter is the root logger that all of the daemon's subloggers are
|
||||
// hooked up to.
|
||||
LogWriter *build.RotatingLogWriter
|
||||
@@ -577,6 +579,7 @@ func DefaultConfig() Config {
|
||||
ChannelCommitInterval: defaultChannelCommitInterval,
|
||||
ChannelCommitBatchSize: defaultChannelCommitBatchSize,
|
||||
CoinSelectionStrategy: defaultCoinSelectionStrategy,
|
||||
RemoteSigner: &lncfg.RemoteSigner{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1556,12 +1559,30 @@ func (c *Config) graphDatabaseDir() string {
|
||||
func (c *Config) ImplementationConfig(
|
||||
interceptor signal.Interceptor) *ImplementationCfg {
|
||||
|
||||
defaultImpl := NewDefaultWalletImpl(c, ltndLog, interceptor)
|
||||
// If we're using a remote signer, we still need the base wallet as a
|
||||
// watch-only source of chain and address data. But we don't need any
|
||||
// private key material in that btcwallet base wallet.
|
||||
if c.RemoteSigner.Enable {
|
||||
rpcImpl := NewRPCSignerWalletImpl(c, ltndLog, interceptor)
|
||||
return &ImplementationCfg{
|
||||
GrpcRegistrar: rpcImpl,
|
||||
RestRegistrar: rpcImpl,
|
||||
ExternalValidator: rpcImpl,
|
||||
DatabaseBuilder: NewDefaultDatabaseBuilder(
|
||||
c, ltndLog,
|
||||
),
|
||||
WalletConfigBuilder: rpcImpl,
|
||||
ChainControlBuilder: rpcImpl,
|
||||
}
|
||||
}
|
||||
|
||||
defaultImpl := NewDefaultWalletImpl(c, ltndLog, interceptor, false)
|
||||
return &ImplementationCfg{
|
||||
GrpcRegistrar: defaultImpl,
|
||||
RestRegistrar: defaultImpl,
|
||||
ExternalValidator: defaultImpl,
|
||||
DatabaseBuilder: NewDefaultDatabaseBuilder(c, ltndLog),
|
||||
WalletConfigBuilder: defaultImpl,
|
||||
ChainControlBuilder: defaultImpl,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user