Browse Source

revert returning empty block (#6647)

pull/6649/head
Callum Waters 3 years ago
committed by GitHub
parent
commit
ba41d29b50
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      rpc/core/blocks.go

+ 4
- 3
rpc/core/blocks.go View File

@ -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
}


Loading…
Cancel
Save