Skip to content

Commit

Permalink
fix: do not shadow clientCtx in start.go (cosmos#14086)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored and haiyizxx committed Feb 21, 2023
1 parent 6a0c8cb commit 10143b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
// service if API or gRPC is enabled, and avoid doing so in the general
// case, because it spawns a new local tendermint RPC client.
if (config.API.Enable || config.GRPC.Enable) && tmNode != nil {
clientCtx := clientCtx.WithClient(local.New(tmNode))
// re-assign for making the client available below
// do not use := to avoid shadowing clientCtx
clientCtx = clientCtx.WithClient(local.New(tmNode))

app.RegisterTxService(clientCtx)
app.RegisterTendermintService(clientCtx)
Expand Down

0 comments on commit 10143b5

Please sign in to comment.