Skip to content

Commit 28c09be

Browse files
committed
loopd: make the LND RPC timeout configurable
1 parent 3d1d3eb commit 28c09be

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

loopd/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ var (
7676
defaultLndMacaroon,
7777
)
7878

79+
// DefaultLndRPCTimeout is the default timeout to use when communicating
80+
// with lnd.
81+
DefaultLndRPCTimeout = time.Minute
82+
7983
// DefaultTLSCertPath is the default full path of the autogenerated TLS
8084
// certificate.
8185
DefaultTLSCertPath = filepath.Join(
@@ -118,6 +122,9 @@ type lndConfig struct {
118122
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."`
119123

120124
TLSPath string `long:"tlspath" description:"Path to lnd tls certificate"`
125+
126+
// RPCTimeout is the timeout to use when communicating with lnd.
127+
RPCTimeout time.Duration `long:"rpctimeout" description:"The timeout to use when communicating with lnd"`
121128
}
122129

123130
type loopServerConfig struct {
@@ -217,6 +224,7 @@ func DefaultConfig() Config {
217224
Lnd: &lndConfig{
218225
Host: "localhost:10009",
219226
MacaroonPath: DefaultLndMacaroonPath,
227+
RPCTimeout: DefaultLndRPCTimeout,
220228
},
221229
}
222230
}

loopd/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func NewListenerConfig(config *Config, rpcCfg RPCConfig) *ListenerCfg {
9696
BlockUntilChainSynced: true,
9797
CallerCtx: callerCtx,
9898
BlockUntilUnlocked: true,
99+
RPCTimeout: cfg.RPCTimeout,
99100
}
100101

101102
// If a custom lnd connection is specified we use that

0 commit comments

Comments
 (0)