@@ -561,8 +561,16 @@ func (ethash *Ethash) Prepare(chain consensus.ChainReader, header *types.Header)
561561}
562562
563563// Finalize implements consensus.Engine, accumulating the block and uncle rewards,
564- // setting the final state and assembling the block.
565- func (ethash * Ethash ) Finalize (chain consensus.ChainReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header , receipts []* types.Receipt ) (* types.Block , error ) {
564+ // setting the final state on the header
565+ func (ethash * Ethash ) Finalize (chain consensus.ChainReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header ) {
566+ // Accumulate any block and uncle rewards and commit the final state root
567+ accumulateRewards (chain .Config (), state , header , uncles )
568+ header .Root = state .IntermediateRoot (chain .Config ().IsEIP158 (header .Number ))
569+ }
570+
571+ // FinalizeAndAssemble implements consensus.Engine, accumulating the block and
572+ // uncle rewards, setting the final state and assembling the block.
573+ func (ethash * Ethash ) FinalizeAndAssemble (chain consensus.ChainReader , header * types.Header , state * state.StateDB , txs []* types.Transaction , uncles []* types.Header , receipts []* types.Receipt ) (* types.Block , error ) {
566574 // Accumulate any block and uncle rewards and commit the final state root
567575 accumulateRewards (chain .Config (), state , header , uncles )
568576 header .Root = state .IntermediateRoot (chain .Config ().IsEIP158 (header .Number ))
0 commit comments