signrpc+subserver: add key chain to signer

This commit is contained in:
Oliver Gugger 2019-12-10 09:48:13 +01:00
parent 699bb193e4
commit d47f67d260
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
2 changed files with 8 additions and 0 deletions

@ -4,6 +4,7 @@ package signrpc
import ( import (
"github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/macaroons" "github.com/lightningnetwork/lnd/macaroons"
) )
@ -30,4 +31,8 @@ type Config struct {
// job of the signer RPC server is simply to proxy valid requests to // job of the signer RPC server is simply to proxy valid requests to
// the active signer instance. // the active signer instance.
Signer input.Signer Signer input.Signer
// KeyRing is an interface that the signer will use to derive any keys
// for signing messages.
KeyRing keychain.SecretKeyRing
} }

@ -130,6 +130,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
subCfgValue.FieldByName("Signer").Set( subCfgValue.FieldByName("Signer").Set(
reflect.ValueOf(cc.signer), reflect.ValueOf(cc.signer),
) )
subCfgValue.FieldByName("KeyRing").Set(
reflect.ValueOf(cc.keyRing),
)
case *walletrpc.Config: case *walletrpc.Config:
subCfgValue := extractReflectValue(subCfg) subCfgValue := extractReflectValue(subCfg)