From a74109ae46566e1ee3e43eb18b9acfe453a9ed1a Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Thu, 14 Apr 2022 10:40:45 -0500 Subject: [PATCH] Call pluginNewHead even when invoked through beacon calls --- core/blockchain.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index 708677b1e..08f60c063 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2125,6 +2125,14 @@ func (bc *BlockChain) SetChainHead(head *types.Block) error { if len(logs) > 0 { 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}) context := []interface{}{