diff --git a/rpc/core/abci.go b/rpc/core/abci.go index a5eede3fc..100176195 100644 --- a/rpc/core/abci.go +++ b/rpc/core/abci.go @@ -1,10 +1,12 @@ package core import ( + "fmt" + abci "github.com/tendermint/tendermint/abci/types" + cmn "github.com/tendermint/tendermint/libs/common" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/version" - cmn "github.com/tendermint/tendermint/libs/common" ) // Query the application for some information. @@ -48,6 +50,10 @@ import ( // | height | int64 | 0 | false | Height (0 means latest) | // | trusted | bool | false | false | Does not include a proof of the data inclusion | func ABCIQuery(path string, data cmn.HexBytes, height int64, trusted bool) (*ctypes.ResultABCIQuery, error) { + if height < 0 { + return nil, fmt.Errorf("height must be non-negative") + } + resQuery, err := proxyAppQuery.QuerySync(abci.RequestQuery{ Path: path, Data: data,