aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-14 04:58:53 +0800
committerobscuren <geffobscura@gmail.com>2015-04-14 04:58:53 +0800
commit4f3c169b4ece4935209ffd060ceaebe1702bc2f0 (patch)
tree6ca6ed7e96263ad90e3200a7b6704d92210b2932 /miner
parentd423305f07fe5390ca957a9f08c93b5e6a3cbef2 (diff)
downloadgo-tangerine-4f3c169b4ece4935209ffd060ceaebe1702bc2f0.tar.gz
go-tangerine-4f3c169b4ece4935209ffd060ceaebe1702bc2f0.tar.zst
go-tangerine-4f3c169b4ece4935209ffd060ceaebe1702bc2f0.zip
miner: don't break loop when encountering gas limit reach err
Processing transactions should continue when a transaction throws a gas limit reached error. Other transactions may actually succeed.
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/miner/worker.go b/miner/worker.go
index b74b67552..141294385 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -172,7 +172,7 @@ out:
case <-self.quit:
break out
case <-timer.C:
- if glog.V(logger.Debug) {
+ if glog.V(logger.Detail) && atomic.LoadInt64(&self.mining) == 1 {
glog.Infoln("Hash rate:", self.HashRate(), "Khash")
}
@@ -264,8 +264,8 @@ func (self *worker) commitNewWork() {
remove = set.New()
tcount = 0
)
-gasLimit:
- for i, tx := range transactions {
+ //gasLimit:
+ for _, tx := range transactions {
self.current.state.StartRecord(tx.Hash(), common.Hash{}, 0)
err := self.commitTransaction(tx)
@@ -276,14 +276,13 @@ gasLimit:
self.chain.TxState().RemoveNonce(from, tx.Nonce())
remove.Add(tx.Hash())
- if glog.V(logger.Debug) {
+ if glog.V(logger.Detail) {
glog.Infof("TX (%x) failed, will be removed: %v\n", tx.Hash().Bytes()[:4], err)
- glog.Infoln(tx)
+ //glog.Infoln(tx)
}
case state.IsGasLimitErr(err):
- glog.V(logger.Debug).Infof("Gas limit reached for block. %d TXs included in this block\n", i)
- // Break on gas limit
- break gasLimit
+ //glog.V(logger.Debug).Infof("Gas limit reached for block. %d TXs included in this block\n", i)
+ //break gasLimit
default:
tcount++
}