Skip to content

Commit f725c3a

Browse files
committed
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`.
1 parent ba3193b commit f725c3a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rpc_proxy.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ func (p *rpcProxy) makeDirector(allowLitRPC bool) func(ctx context.Context,
323323
)
324324
}
325325

326+
// If the rpcProxy has not started yet, then the lnd connection
327+
// will not be initialised yet.
328+
if !p.hasStarted() {
329+
return outCtx, nil, ErrWaitingToStart
330+
}
331+
326332
return outCtx, p.lndConn, nil
327333
}
328334
}

0 commit comments

Comments
 (0)