diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-06 17:54:11 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-06 18:43:05 +0800 |
commit | e6bb9c1cadd311475f54ed60630fc20eb2f54871 (patch) | |
tree | 60d3b8e8f0cfcf002a6838404f7de21ea1ef5c29 /miner | |
parent | aa4502060b50733a3a82a0ab575eac0731cdb7ca (diff) | |
download | dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.tar dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.tar.gz dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.tar.bz2 dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.tar.lz dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.tar.xz dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.tar.zst dexon-e6bb9c1cadd311475f54ed60630fc20eb2f54871.zip |
core, miner: removed vm errors from consensus err checking
Removed VM errors from the consensus errors. They now used for output
only.
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 14 |
1 files changed, 7 insertions, 7 deletions
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 } |