aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 61091f3c0..7ef113fd4 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -205,22 +205,21 @@ 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):
fallthrough
case core.IsInvalidTxErr(err):
// 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)
@@ -261,7 +260,6 @@ func (self *worker) commitUncle(uncle *types.Header) error {
func (self *worker) commitTransaction(tx *types.Transaction) error {
snap := self.current.state.Copy()
- //fmt.Printf("proc %x %v\n", tx.Hash()[:3], tx.Nonce())
receipt, _, err := self.proc.ApplyTransaction(self.current.coinbase, self.current.state, self.current.block, tx, self.current.totalUsedGas, true)
if err != nil && (core.IsNonceErr(err) || state.IsGasLimitErr(err) || core.IsInvalidTxErr(err)) {
self.current.state.Set(snap)