Unverified Commit c7d07294 authored by Diederik Loerakker's avatar Diederik Loerakker Committed by GitHub

catalyst: check if block exists in assemble-block call with unknown parent-hash (#22770)

parent 871f50b9
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment