diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-12 00:37:17 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-12 00:37:17 +0800 |
commit | 239e17de126a3d7afa29da7ee423ffc79757877f (patch) | |
tree | e2f844a7b2a1ad88010745449863aa6f1cc14da4 /miner | |
parent | 61bf29be36a6678ba16c457229ca306339ea4ebc (diff) | |
parent | c01d4c2f4c8704656e407ab4d80d9ec82e016731 (diff) | |
download | dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.gz dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.bz2 dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.lz dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.xz dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.zst dexon-239e17de126a3d7afa29da7ee423ffc79757877f.zip |
Merge branch 'rpcfrontier' into develop
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go index 21a0522e8..61091f3c0 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -209,6 +209,8 @@ gasLimit: err := self.commitTransaction(tx) switch { case core.IsNonceErr(err): + fallthrough + case core.IsInvalidTxErr(err): // Remove invalid transactions remove = append(remove, tx) case state.IsGasLimitErr(err): @@ -222,7 +224,7 @@ gasLimit: } self.eth.TxPool().RemoveSet(remove) - self.current.coinbase.AddBalance(core.BlockReward) + self.current.state.AddBalance(self.coinbase, core.BlockReward) self.current.state.Update(ethutil.Big0) self.push() @@ -258,9 +260,11 @@ 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)) { + if err != nil && (core.IsNonceErr(err) || state.IsGasLimitErr(err) || core.IsInvalidTxErr(err)) { + self.current.state.Set(snap) return err } |