Merge pull request #44 from openrelayxyz/bugfix/beaconNewhead

Call pluginNewHead even when invoked through beacon calls
This commit is contained in:
AusIV 2022-05-16 12:05:07 -05:00 committed by GitHub
commit 9b75b91e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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{}{