Improved errors. Closes #475

pull/484/head
obscuren 10 years ago
parent 51df765e38
commit 532a74f50e
  1. 4
      core/chain_manager.go
  2. 8
      miner/worker.go

@ -418,9 +418,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
} }
h := block.Header() h := block.Header()
chainlogger.Infof("block #%v process failed (%x)\n", h.Number, h.Hash()[:4]) chainlogger.Infof("INVALID block #%v (%x)\n", h.Number, h.Hash()[:4])
chainlogger.Infoln(block)
chainlogger.Infoln(err) chainlogger.Infoln(err)
chainlogger.Debufln(block)
return err return err
} }
block.Td = td block.Td = td

@ -205,7 +205,7 @@ func (self *worker) commitNewWork() {
// Keep track of transactions which return errors so they can be removed // Keep track of transactions which return errors so they can be removed
var remove types.Transactions var remove types.Transactions
gasLimit: gasLimit:
for _, tx := range transactions { for i, tx := range transactions {
err := self.commitTransaction(tx) err := self.commitTransaction(tx)
switch { switch {
case core.IsNonceErr(err): case core.IsNonceErr(err):
@ -214,14 +214,12 @@ gasLimit:
// Remove invalid transactions // Remove invalid transactions
self.chain.TxState().RemoveNonce(tx.From(), tx.Nonce()) self.chain.TxState().RemoveNonce(tx.From(), tx.Nonce())
remove = append(remove, tx) remove = append(remove, tx)
minerlogger.Infof("TX (%x) failed. Transaction will be removed\n", tx.Hash()[:4])
case state.IsGasLimitErr(err): case state.IsGasLimitErr(err):
minerlogger.Infof("Gas limit reached for block. %d TXs included in this block\n", i)
// Break on gas limit // Break on gas limit
break gasLimit break gasLimit
} }
if err != nil {
minerlogger.Infoln(err)
}
} }
self.eth.TxPool().RemoveSet(remove) self.eth.TxPool().RemoveSet(remove)

Loading…
Cancel
Save