aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-14 19:43:10 +0800
committerobscuren <geffobscura@gmail.com>2015-03-14 19:43:10 +0800
commit532a74f50e6e79314816edbc14e5da7449a50709 (patch)
tree02e561960fe71263d5e8d4015468b16dc08a69ca
parent51df765e3892285bda6d40340dc6febfcd2e7ce6 (diff)
downloaddexon-532a74f50e6e79314816edbc14e5da7449a50709.tar
dexon-532a74f50e6e79314816edbc14e5da7449a50709.tar.gz
dexon-532a74f50e6e79314816edbc14e5da7449a50709.tar.bz2
dexon-532a74f50e6e79314816edbc14e5da7449a50709.tar.lz
dexon-532a74f50e6e79314816edbc14e5da7449a50709.tar.xz
dexon-532a74f50e6e79314816edbc14e5da7449a50709.tar.zst
dexon-532a74f50e6e79314816edbc14e5da7449a50709.zip
Improved errors. Closes #475
-rw-r--r--core/chain_manager.go4
-rw-r--r--miner/worker.go8
2 files changed, 5 insertions, 7 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 5879d20a3..af9053820 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -418,9 +418,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
}
h := block.Header()
- chainlogger.Infof("block #%v process failed (%x)\n", h.Number, h.Hash()[:4])
- chainlogger.Infoln(block)
+ chainlogger.Infof("INVALID block #%v (%x)\n", h.Number, h.Hash()[:4])
chainlogger.Infoln(err)
+ chainlogger.Debufln(block)
return err
}
block.Td = td
diff --git a/miner/worker.go b/miner/worker.go
index a39a0b43b..7ef113fd4 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -205,7 +205,7 @@ func (self *worker) commitNewWork() {
// Keep track of transactions which return errors so they can be removed
var remove types.Transactions
gasLimit:
- for _, tx := range transactions {
+ for i, tx := range transactions {
err := self.commitTransaction(tx)
switch {
case core.IsNonceErr(err):
@@ -214,14 +214,12 @@ gasLimit:
// Remove invalid transactions
self.chain.TxState().RemoveNonce(tx.From(), tx.Nonce())
remove = append(remove, tx)
+ minerlogger.Infof("TX (%x) failed. Transaction will be removed\n", tx.Hash()[:4])
case state.IsGasLimitErr(err):
+ minerlogger.Infof("Gas limit reached for block. %d TXs included in this block\n", i)
// Break on gas limit
break gasLimit
}
-
- if err != nil {
- minerlogger.Infoln(err)
- }
}
self.eth.TxPool().RemoveSet(remove)