diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-06 02:51:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-06 02:51:25 +0800 |
commit | 88ff13c241faff1d58e47f12bd283c112de7225a (patch) | |
tree | b7bd2595ba702c086d8226cca4adaeeee0505bd5 /core/state_transition.go | |
parent | ca1093f8485595b34781307eb2b673d0d81d8fb9 (diff) | |
download | dexon-88ff13c241faff1d58e47f12bd283c112de7225a.tar.gz dexon-88ff13c241faff1d58e47f12bd283c112de7225a.tar.zst dexon-88ff13c241faff1d58e47f12bd283c112de7225a.zip |
Spec changes.
* All errors during state transition result in an invalid tx
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/state_transition.go b/core/state_transition.go index 00e383f3f..f54acd6ee 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -3,6 +3,7 @@ package core import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/state" @@ -185,7 +186,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) { } } if err = self.UseGas(big.NewInt(dgas)); err != nil { - return + return nil, InvalidTxError(err) } //stateCopy := self.env.State().Copy() @@ -231,10 +232,16 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) { */ } - if err != nil { - self.UseGas(self.gas) + if err != nil && IsValueTransferErr(err) { + return nil, InvalidTxError(err) } + /* + if err != nil { + self.UseGas(self.gas) + } + */ + return } |