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

This commit is contained in:
Diederik Loerakker authored and GitHub committed 2021-04-29 16:42:21 +02:00
1 parent 871f50b911
commit c7d07294a6
1 file changed
+5
+5
View File
@@ -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 {