Skip to content

Commit

Permalink
Merge pull request #86 from wdstorer-bg/BG-52292-add-rpctimeout
Browse files Browse the repository at this point in the history
config: add rpctimeout
  • Loading branch information
GeorgeTsagk authored Sep 12, 2022
2 parents d0d214c + 85302f0 commit af15c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package lndmon

import (
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/lightninglabs/lndmon/collectors"
)
Expand Down Expand Up @@ -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"`
}
Expand All @@ -55,6 +60,7 @@ var defaultConfig = config{
Network: "mainnet",
MacaroonDir: defaultMacaroonDir,
MacaroonName: defaultMacaroon,
RPCTimeout: 30 * time.Second,
},
}

Expand Down
3 changes: 2 additions & 1 deletion lndmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit af15c30

Please sign in to comment.