diff --git a/api/api_types.go b/api/api_types.go index 1b8c89a21..30faea086 100644 --- a/api/api_types.go +++ b/api/api_types.go @@ -448,6 +448,8 @@ type Block struct { comettypes.Header `json:"header"` Hash types.HexBytes `json:"hash" ` TxCount int64 `json:"txCount"` + // Data is not used anymore but kept here for a hotfix + Data comettypes.Data `json:"data"` } // BlockList is used to return a paginated list to the client diff --git a/api/chain.go b/api/chain.go index 1b4d5ca14..d22572162 100644 --- a/api/chain.go +++ b/api/chain.go @@ -929,6 +929,10 @@ func (a *API) chainBlockByHeightHandler(_ *apirest.APIdata, ctx *httprouter.HTTP if err != nil { return ErrIndexerQueryFailed.WithErr(err) } + dummyTxs := comettypes.Txs{} + for i := int64(0); i < txcount; i++ { + dummyTxs = append(dummyTxs, comettypes.Tx{}) + } block := &Block{ Header: comettypes.Header{ ChainID: idxblock.ChainID, @@ -941,6 +945,9 @@ func (a *API) chainBlockByHeightHandler(_ *apirest.APIdata, ctx *httprouter.HTTP }, Hash: idxblock.Hash, TxCount: txcount, + Data: comettypes.Data{ + Txs: dummyTxs, + }, } data, err := json.Marshal(block) if err != nil {