diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-17 00:25:24 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-17 00:25:24 +0800 |
commit | 5a0e75173626704c3d58be582dff318218569ef3 (patch) | |
tree | 801ec6d33fe21e46230a3082cd069534f64aa251 /ethminer | |
parent | 006ac772e6c81271a84ff56e00527b2adbc0129c (diff) | |
parent | ff0f15f7634ca713b0ce8232a8fa63eec5c3fad7 (diff) | |
download | go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.tar go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.tar.gz go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.tar.bz2 go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.tar.lz go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.tar.xz go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.tar.zst go-tangerine-5a0e75173626704c3d58be582dff318218569ef3.zip |
Merge branch 'release/0.5.13'
Diffstat (limited to 'ethminer')
-rw-r--r-- | ethminer/miner.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ethminer/miner.go b/ethminer/miner.go index 19ff5dd9e..1ef9ca229 100644 --- a/ethminer/miner.go +++ b/ethminer/miner.go @@ -136,11 +136,21 @@ func (self *Miner) mineNewBlock() { // Sort the transactions by nonce in case of odd network propagation sort.Sort(ethchain.TxByNonce{self.txs}) + // Accumulate all valid transaction and apply them to the new state - receipts, txs := stateManager.ApplyTransactions(self.block.State(), self.block, self.txs) - self.txs = txs + // Error may be ignored. It's not important during mining + parent := self.ethereum.BlockChain().GetBlock(self.block.PrevHash) + coinbase := self.block.State().GetOrNewStateObject(self.block.Coinbase) + coinbase.SetGasPool(self.block.CalcGasLimit(parent)) + receipts, txs, unhandledTxs, err := stateManager.ProcessTransactions(coinbase, self.block.State(), self.block, self.block, self.txs) + if err != nil { + ethutil.Config.Log.Debugln("[MINER]", err) + } + self.txs = append(txs, unhandledTxs...) + // Set the transactions to the block so the new SHA3 can be calculated self.block.SetReceipts(receipts, txs) + // Accumulate the rewards included for this block stateManager.AccumelateRewards(self.block.State(), self.block) @@ -155,6 +165,7 @@ func (self *Miner) mineNewBlock() { } else { self.ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{self.block.Value().Val}) ethutil.Config.Log.Infof("[MINER] 🔨 Mined block %x\n", self.block.Hash()) + ethutil.Config.Log.Infoln(self.block) // Gather the new batch of transactions currently in the tx pool self.txs = self.ethereum.TxPool().CurrentTransactions() } |