good morning!!!!

Skip to content
Snippets Groups Projects
Commit b98cc2fb authored by Maran Hidskes's avatar Maran Hidskes
Browse files

Fixed GetBlock when no block can be found

parent fde3e01f
Branches
Tags
No related merge requests found
...@@ -24,7 +24,15 @@ func (lib *PEthereum) GetBlock(hexHash string) *PBlock { ...@@ -24,7 +24,15 @@ func (lib *PEthereum) GetBlock(hexHash string) *PBlock {
block := lib.blockChain.GetBlock(hash) block := lib.blockChain.GetBlock(hash)
return &PBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Hex(block.Hash())} var blockInfo *PBlock
if block != nil {
blockInfo = &PBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Hex(block.Hash())}
} else {
blockInfo = &PBlock{Number: -1, Hash: ""}
}
return blockInfo
} }
func (lib *PEthereum) GetKey() *PKey { func (lib *PEthereum) GetKey() *PKey {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment