mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
config: add ChainRPC config
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/lightningnetwork/lnd/autopilot"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/autopilotrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/chainrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/signrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
@ -31,6 +32,11 @@ type subRPCServerConfigs struct {
|
||||
// AutopilotRPC is a sub-RPC server that exposes methods on the running
|
||||
// autopilot as a gRPC service.
|
||||
AutopilotRPC *autopilotrpc.Config `group:"autopilotrpc" namespace:"autopilotrpc"`
|
||||
|
||||
// ChainRPC is a sub-RPC server that exposes functionality allowing a
|
||||
// client to be notified of certain on-chain events (new blocks,
|
||||
// confirmations, spends).
|
||||
ChainRPC *chainrpc.Config `group:"chainrpc" namespace:"chainrpc"`
|
||||
}
|
||||
|
||||
// PopulateDependencies attempts to iterate through all the sub-server configs
|
||||
@ -106,6 +112,19 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
|
||||
reflect.ValueOf(atpl),
|
||||
)
|
||||
|
||||
case *chainrpc.Config:
|
||||
subCfgValue := extractReflectValue(cfg)
|
||||
|
||||
subCfgValue.FieldByName("NetworkDir").Set(
|
||||
reflect.ValueOf(networkDir),
|
||||
)
|
||||
subCfgValue.FieldByName("MacService").Set(
|
||||
reflect.ValueOf(macService),
|
||||
)
|
||||
subCfgValue.FieldByName("ChainNotifier").Set(
|
||||
reflect.ValueOf(cc.chainNotifier),
|
||||
)
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unknown field: %v, %T", fieldName,
|
||||
cfg)
|
||||
|
Reference in New Issue
Block a user