From 88fa30a4ea784e96d46ee1fd2a1112ff16575fdf Mon Sep 17 00:00:00 2001 From: parmarrushabh Date: Tue, 4 Dec 2018 14:57:51 +0530 Subject: [PATCH] move cache data to insert func --- core/blockchain.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index cd6f235c2e..9240f9d3ed 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -506,6 +506,10 @@ func (bc *BlockChain) insert(block *types.Block) { } bc.currentBlock.Store(block) + // save cache BlockSigners + engine := bc.Engine().(*posv.Posv) + engine.CacheData(block.Header(), block.Transactions(), bc.GetReceiptsByHash(block.Hash())) + // If the block is better than our head or is on a different chain, force update heads if updateHeads { bc.hc.SetCurrentHeader(block.Header())