rpc_proxy: check hasStarted before using lnd connection

In the rpcProxy `makeDirector` method, we need to check if the rpcProxy
has started before making use of the `lndConn`.
This commit is contained in:
Elle Mouton 2023-05-03 11:01:17 +02:00
parent ba3193b341
commit f725c3a959
No known key found for this signature in database
GPG key ID: D7D916376026F177

View file

@ -323,6 +323,12 @@ func (p *rpcProxy) makeDirector(allowLitRPC bool) func(ctx context.Context,
)
}
// If the rpcProxy has not started yet, then the lnd connection
// will not be initialised yet.
if !p.hasStarted() {
return outCtx, nil, ErrWaitingToStart
}
return outCtx, p.lndConn, nil
}
}