diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-09-08 01:43:01 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-09-11 22:42:25 +0800 |
commit | cdc2662c4098d68a7b450b9b9ff2688acbffcee4 (patch) | |
tree | 2dfb3b7365895203132bd6d1aa650b5a239b01eb /miner/worker.go | |
parent | 2b339cbbd8bb475d2195d54a71dcced700003430 (diff) | |
download | dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.gz dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.zst dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.zip |
core: split out TD from database and all internals
Diffstat (limited to 'miner/worker.go')
-rw-r--r-- | miner/worker.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/miner/worker.go b/miner/worker.go index 16a16931d..2f43b110f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -283,7 +283,7 @@ func (self *worker) wait() { continue } - stat, err := self.chain.WriteBlock(block, false) + stat, err := self.chain.WriteBlock(block) if err != nil { glog.V(logger.Error).Infoln("error writing block to chain", err) continue @@ -533,14 +533,12 @@ func (self *worker) commitNewWork() { // create the new block whose nonce will be mined. work.Block = types.NewBlock(header, work.txs, uncles, work.receipts) - work.Block.Td = new(big.Int).Set(core.CalcTD(work.Block, self.chain.GetBlock(work.Block.ParentHash()))) // We only care about logging if we're actually mining. if atomic.LoadInt32(&self.mining) == 1 { glog.V(logger.Info).Infof("commit new work on block %v with %d txs & %d uncles. Took %v\n", work.Block.Number(), work.tcount, len(uncles), time.Since(tstart)) self.logLocalMinedBlocks(work, previous) } - self.push(work) } |