diff --git a/config.go b/config.go index 267c5ff..774ca9d 100755 --- a/config.go +++ b/config.go @@ -1,6 +1,8 @@ package lndmon import ( + "time" + "github.com/btcsuite/btcd/btcutil" "github.com/lightninglabs/lndmon/collectors" ) @@ -29,6 +31,9 @@ type lndConfig struct { // MacaroonName is the name of the macaroon in macaroon dir to use. MacaroonName string `long:"macaroonname" description:"The name of our macaroon in macaroon dir to use."` + // RPCTimeout is the timeout for rpc calls to lnd. + RPCTimeout time.Duration `long:"rpctimeout" description:"The timeout for rpc calls to lnd. Valid time units are {s, m, h}."` + // TLSPath is the path to the lnd TLS certificate. TLSPath string `long:"tlspath" description:"Path to lnd tls certificate"` } @@ -55,6 +60,7 @@ var defaultConfig = config{ Network: "mainnet", MacaroonDir: defaultMacaroonDir, MacaroonName: defaultMacaroon, + RPCTimeout: 30 * time.Second, }, } diff --git a/lndmon.go b/lndmon.go index e72917d..85af1a4 100755 --- a/lndmon.go +++ b/lndmon.go @@ -44,7 +44,8 @@ func start() error { CustomMacaroonPath: filepath.Join( cfg.Lnd.MacaroonDir, cfg.Lnd.MacaroonName, ), - TLSPath: cfg.Lnd.TLSPath, + RPCTimeout: cfg.Lnd.RPCTimeout, + TLSPath: cfg.Lnd.TLSPath, CheckVersion: &verrpc.Version{ AppMajor: 0, AppMinor: 13,