From e6bb9c1cadd311475f54ed60630fc20eb2f54871 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Mon, 6 Jul 2015 11:54:11 +0200 Subject: core, miner: removed vm errors from consensus err checking Removed VM errors from the consensus errors. They now used for output only. --- miner/worker.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'miner/worker.go') diff --git a/miner/worker.go b/miner/worker.go index c28258799..840609721 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -524,18 +524,18 @@ func (env *environment) commitTransactions(transactions types.Transactions, gasP err := env.commitTransaction(tx, proc) switch { - case core.IsNonceErr(err) || core.IsInvalidTxErr(err): - env.remove.Add(tx.Hash()) - - if glog.V(logger.Detail) { - glog.Infof("TX (%x) failed, will be removed: %v\n", tx.Hash().Bytes()[:4], err) - } case state.IsGasLimitErr(err): // ignore the transactor so no nonce errors will be thrown for this account // next time the worker is run, they'll be picked up again. env.ignoredTransactors.Add(from) glog.V(logger.Detail).Infof("Gas limit reached for (%x) in this block. Continue to try smaller txs\n", from[:4]) + case err != nil: + env.remove.Add(tx.Hash()) + + if glog.V(logger.Detail) { + glog.Infof("TX (%x) failed, will be removed: %v\n", tx.Hash().Bytes()[:4], err) + } default: env.tcount++ } @@ -545,7 +545,7 @@ func (env *environment) commitTransactions(transactions types.Transactions, gasP func (env *environment) commitTransaction(tx *types.Transaction, proc *core.BlockProcessor) error { snap := env.state.Copy() receipt, _, err := proc.ApplyTransaction(env.coinbase, env.state, env.header, tx, env.header.GasUsed, true) - if err != nil && (core.IsNonceErr(err) || state.IsGasLimitErr(err) || core.IsInvalidTxErr(err)) { + if err != nil { env.state.Set(snap) return err } -- cgit