From 9be7853e349f97917120fd925e2c5a462bd78846 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 23 Mar 2015 16:35:44 +0100 Subject: Fixed issues with stalled remote miner --- miner/worker.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'miner/worker.go') diff --git a/miner/worker.go b/miner/worker.go index ff500b156..587036f22 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -213,9 +213,11 @@ func (self *worker) commitNewWork() { transactions := self.eth.TxPool().GetTransactions() sort.Sort(types.TxByNonce{transactions}) - minerlogger.Infof("committing new work with %d txs\n", len(transactions)) // Keep track of transactions which return errors so they can be removed - var remove types.Transactions + var ( + remove types.Transactions + tcount = 0 + ) gasLimit: for i, tx := range transactions { err := self.commitTransaction(tx) @@ -233,6 +235,8 @@ gasLimit: minerlogger.Infof("Gas limit reached for block. %d TXs included in this block\n", i) // Break on gas limit break gasLimit + default: + tcount++ } } self.eth.TxPool().RemoveSet(remove) @@ -251,7 +255,8 @@ gasLimit: uncles = append(uncles, uncle.Header()) } } - minerlogger.Infoln("Included", len(uncles), "uncle(s)") + minerlogger.Infof("commit new work with %d txs & %d uncles\n", tcount, len(uncles)) + self.current.block.SetUncles(uncles) self.current.state.AddBalance(self.coinbase, core.BlockReward) -- cgit v1.2.3