aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-07 20:57:04 +0800
committerobscuren <geffobscura@gmail.com>2015-04-07 20:57:04 +0800
commit688d118c7e0d439691e84fc6e068ab3e19da5185 (patch)
tree6891a60950e0c2956c9f2d4fed6fceb67430775c /miner/worker.go
parent01b2c90179ff82e4610745aea0e3e3ca53756305 (diff)
downloadgo-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.gz
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.bz2
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.lz
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.xz
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.tar.zst
go-tangerine-688d118c7e0d439691e84fc6e068ab3e19da5185.zip
Updated logging
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/miner/worker.go b/miner/worker.go
index ffd4af7d3..8613df1c0 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -276,12 +276,12 @@ gasLimit:
self.chain.TxState().RemoveNonce(from, tx.Nonce())
remove = append(remove, tx)
- if glog.V(logger.Info) {
+ if glog.V(logger.Debug) {
glog.Infof("TX (%x) failed, will be removed: %v\n", tx.Hash().Bytes()[:4], err)
+ glog.Infoln(tx)
}
- glog.V(logger.Debug).Infoln(tx)
case state.IsGasLimitErr(err):
- glog.V(logger.Info).Infof("Gas limit reached for block. %d TXs included in this block\n", i)
+ glog.V(logger.Debug).Infof("Gas limit reached for block. %d TXs included in this block\n", i)
// Break on gas limit
break gasLimit
default:
@@ -300,15 +300,20 @@ gasLimit:
}
if err := self.commitUncle(uncle.Header()); err != nil {
- glog.V(logger.Info).Infof("Bad uncle found and will be removed (%x)\n", hash[:4])
+ glog.V(logger.Debug).Infof("Bad uncle found and will be removed (%x)\n", hash[:4])
glog.V(logger.Debug).Infoln(uncle)
badUncles = append(badUncles, hash)
} else {
- glog.V(logger.Info).Infof("commiting %x as uncle\n", hash[:4])
+ glog.V(logger.Debug).Infof("commiting %x as uncle\n", hash[:4])
uncles = append(uncles, uncle.Header())
}
}
- glog.V(logger.Info).Infof("commit new work on block %v with %d txs & %d uncles\n", self.current.block.Number(), tcount, len(uncles))
+
+ // We only care about logging if we're actually mining
+ if atomic.LoadInt64(&self.mining) == 1 {
+ glog.V(logger.Info).Infof("commit new work on block %v with %d txs & %d uncles\n", self.current.block.Number(), tcount, len(uncles))
+ }
+
for _, hash := range badUncles {
delete(self.possibleUncles, hash)
}