forked from cerc-io/plugeth
Initial commit of v1.10.14 merge
This commit is contained in:
@@ -1293,6 +1293,13 @@ func (bc *BlockChain) writeBlockAndSetHead(block *types.Block, receipts []*types
|
||||
}
|
||||
bc.futureBlocks.Remove(block.Hash())
|
||||
|
||||
ptd := bc.GetTd(block.ParentHash(), block.NumberU64()-1)
|
||||
if ptd == nil {
|
||||
return WriteStatus(0), consensus.ErrUnknownAncestor
|
||||
}
|
||||
// Make sure no inconsistent state is leaked during insertion
|
||||
externTd := new(big.Int).Add(block.Difficulty(), ptd)
|
||||
|
||||
if status == CanonStatTy {
|
||||
pluginNewHead(block, block.Hash(), logs, externTd)
|
||||
bc.chainFeed.Send(ChainEvent{Block: block, Hash: block.Hash(), Logs: logs})
|
||||
|
||||
Reference in New Issue
Block a user