diff --git a/config.go b/config.go index 475af83..9620503 100644 --- a/config.go +++ b/config.go @@ -106,6 +106,9 @@ type LndConfig struct { // TLSCertPath is the path to the tls cert that faraday should use. TLSCertPath string `long:"tlscertpath" description:"Path to TLS cert"` + + // RequestTimeout is the maximum time to wait for a response from lnd. + RequestTimeout time.Duration `long:"requesttimeout" description:"The maximum time to wait for a response from lnd, if not set the default of 30 seconds will be used."` } type Config struct { //nolint:maligned diff --git a/faraday.go b/faraday.go index f3a1d60..7363e8b 100644 --- a/faraday.go +++ b/faraday.go @@ -76,6 +76,7 @@ func Main() error { CustomMacaroonPath: config.Lnd.MacaroonPath, TLSPath: config.Lnd.TLSCertPath, CheckVersion: MinLndVersion, + RPCTimeout: config.Lnd.RequestTimeout, }) if err != nil { return fmt.Errorf("cannot connect to lightning services: %v",