good morning!!!!

Skip to content
Snippets Groups Projects
Commit ece29c5d authored by Taylor Gerring's avatar Taylor Gerring
Browse files

Nil check block

parent 499f816e
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,10 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) { ...@@ -91,6 +91,10 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
} }
func NewBlockRes(block *types.Block) *BlockRes { func NewBlockRes(block *types.Block) *BlockRes {
if block == nil {
return &BlockRes{}
}
res := new(BlockRes) res := new(BlockRes)
res.BlockNumber = block.Number().Int64() res.BlockNumber = block.Number().Int64()
res.BlockHash = block.Hash() res.BlockHash = block.Hash()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment