Call pluginNewHead even when invoked through beacon calls

This commit is contained in:
Austin Roberts 2022-04-14 10:40:45 -05:00
parent 011619ec82
commit a74109ae46

View File

@ -2125,6 +2125,14 @@ func (bc *BlockChain) SetChainHead(head *types.Block) error {
if len(logs) > 0 { if len(logs) > 0 {
bc.logsFeed.Send(logs) bc.logsFeed.Send(logs)
} }
// begin plugeth code injection
ptd := bc.GetTd(head.ParentHash(), head.NumberU64()-1)
externTd := ptd
if ptd != nil {
externTd = new(big.Int).Add(head.Difficulty(), ptd)
}
pluginNewHead(head, head.Hash(), logs, externTd)
// end plugeth code injection
bc.chainHeadFeed.Send(ChainHeadEvent{Block: head}) bc.chainHeadFeed.Send(ChainHeadEvent{Block: head})
context := []interface{}{ context := []interface{}{