Skip to content

Commit

Permalink
catalyst: check if block exists in assemble-block call with unknown p…
Browse files Browse the repository at this point in the history
…arent-hash (ethereum#22770)
  • Loading branch information
protolambda authored and atif-konasl committed Oct 15, 2021
1 parent 0153748 commit 6d16e39
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ func (api *consensusAPI) AssembleBlock(params assembleBlockParams) (*executableD

bc := api.eth.BlockChain()
parent := bc.GetBlockByHash(params.ParentHash)
if parent == nil {
log.Warn("Cannot assemble block with parent hash to unknown block", "parentHash", params.ParentHash)
return nil, fmt.Errorf("cannot assemble block with unknown parent %s", params.ParentHash)
}

pool := api.eth.TxPool()

if parent.Time() >= params.Timestamp {
Expand Down

0 comments on commit 6d16e39

Please sign in to comment.