mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 21:36:26 +00:00
revert returning empty block (#6647)
This commit is contained in:
@@ -96,11 +96,12 @@ func (env *Environment) Block(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
block := env.BlockStore.LoadBlock(height)
|
||||
blockMeta := env.BlockStore.LoadBlockMeta(height)
|
||||
if blockMeta == nil || block == nil {
|
||||
return &ctypes.ResultBlock{BlockID: types.BlockID{}, Block: &types.Block{}}, nil
|
||||
if blockMeta == nil {
|
||||
return &ctypes.ResultBlock{BlockID: types.BlockID{}, Block: nil}, nil
|
||||
}
|
||||
|
||||
block := env.BlockStore.LoadBlock(height)
|
||||
return &ctypes.ResultBlock{BlockID: blockMeta.BlockID, Block: block}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user