Skip to content

Commit

Permalink
fix: avoid broadcasting tx through query (cosmos#15044)
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica authored and p0mvn committed Feb 21, 2023
1 parent 1966e58 commit 6c38fba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
req.Height = app.LastBlockHeight()
}

if req.Path == "/cosmos.tx.v1beta1.Service/BroadcastTx" {
return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace)
}

// handle gRPC routes first rather than calling splitPath because '/' characters
// are used as part of gRPC paths
if grpcHandler := app.grpcQueryRouter.Route(req.Path); grpcHandler != nil {
Expand Down

0 comments on commit 6c38fba

Please sign in to comment.