diff --git a/loopd/config.go b/loopd/config.go index 423784ae..2c417b72 100644 --- a/loopd/config.go +++ b/loopd/config.go @@ -76,6 +76,10 @@ var ( defaultLndMacaroon, ) + // DefaultLndRPCTimeout is the default timeout to use when communicating + // with lnd. + DefaultLndRPCTimeout = time.Minute + // DefaultTLSCertPath is the default full path of the autogenerated TLS // certificate. DefaultTLSCertPath = filepath.Join( @@ -118,6 +122,9 @@ type lndConfig struct { MacaroonPath string `long:"macaroonpath" description:"The full path to the single macaroon to use, either the admin.macaroon or a custom baked one. Cannot be specified at the same time as macaroondir. A custom macaroon must contain ALL permissions required for all subservers to work, otherwise permission errors will occur."` TLSPath string `long:"tlspath" description:"Path to lnd tls certificate"` + + // RPCTimeout is the timeout to use when communicating with lnd. + RPCTimeout time.Duration `long:"rpctimeout" description:"The timeout to use when communicating with lnd"` } type loopServerConfig struct { @@ -217,6 +224,7 @@ func DefaultConfig() Config { Lnd: &lndConfig{ Host: "localhost:10009", MacaroonPath: DefaultLndMacaroonPath, + RPCTimeout: DefaultLndRPCTimeout, }, } } diff --git a/loopd/run.go b/loopd/run.go index 151890cd..34b2cd70 100644 --- a/loopd/run.go +++ b/loopd/run.go @@ -96,6 +96,7 @@ func NewListenerConfig(config *Config, rpcCfg RPCConfig) *ListenerCfg { BlockUntilChainSynced: true, CallerCtx: callerCtx, BlockUntilUnlocked: true, + RPCTimeout: cfg.RPCTimeout, } // If a custom lnd connection is specified we use that