From 549b08d9530b56602823b23462331a475ab6ff3a Mon Sep 17 00:00:00 2001 From: AnilChinchawale Date: Tue, 27 Nov 2018 10:15:34 +0530 Subject: [PATCH] rollback fix duplicate count reward --- miner/worker.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 3fc2d989a2..5609d24565 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -612,12 +612,12 @@ func (self *worker) commitNewWork() { delete(self.possibleUncles, hash) } } + // Create the new block to seal with the consensus engine + if work.Block, err = self.engine.Finalize(self.chain, header, work.state, work.txs, uncles, work.receipts); err != nil { + log.Error("Failed to finalize block for sealing", "err", err) + return + } if atomic.LoadInt32(&self.mining) == 1 { - // Create the new block to seal with the consensus engine - if work.Block, err = self.engine.Finalize(self.chain, header, work.state, work.txs, uncles, work.receipts); err != nil { - log.Error("Failed to finalize block for sealing", "err", err) - return - } log.Info("Committing new block", "number", work.Block.Number(), "txs", work.tcount, "special txs", len(specialTxs), "uncles", len(uncles), "elapsed", common.PrettyDuration(time.Since(tstart))) self.unconfirmed.Shift(work.Block.NumberU64() - 1) self.lastParentBlockCommit = parent.Hash().Hex() @@ -788,4 +788,4 @@ func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, c env.receipts = append(env.receipts, receipt) return nil, receipt.Logs -} +} \ No newline at end of file