aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_transition.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-03 23:20:38 +0800
committerobscuren <geffobscura@gmail.com>2015-03-03 23:20:38 +0800
commitc74c07eed19f8a328f47aca7b9e01dcdf8731847 (patch)
treef5c7ed0bdae761d00521f3987bd92497d1d035a2 /core/state_transition.go
parent6518da7c0123168061b97e259e75a39c7f6b1638 (diff)
downloaddexon-c74c07eed19f8a328f47aca7b9e01dcdf8731847.tar.gz
dexon-c74c07eed19f8a328f47aca7b9e01dcdf8731847.tar.zst
dexon-c74c07eed19f8a328f47aca7b9e01dcdf8731847.zip
Fixed error for invalid transaction
Diffstat (limited to 'core/state_transition.go')
-rw-r--r--core/state_transition.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/state_transition.go b/core/state_transition.go
index 751806843..00e383f3f 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -3,7 +3,6 @@ package core
import (
"fmt"
"math/big"
-
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
@@ -146,7 +145,7 @@ func (self *StateTransition) preCheck() (err error) {
// Pre-pay gas / Buy gas of the coinbase account
if err = self.BuyGas(); err != nil {
- return err
+ return InvalidTxError(err)
}
return nil
@@ -167,15 +166,15 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
defer self.RefundGas()
- // Increment the nonce for the next transaction
- self.state.SetNonce(sender.Address(), sender.Nonce()+1)
- //sender.Nonce += 1
-
// Transaction gas
if err = self.UseGas(vm.GasTx); err != nil {
- return
+ return nil, InvalidTxError(err)
}
+ // Increment the nonce for the next transaction
+ self.state.SetNonce(sender.Address(), sender.Nonce()+1)
+ //sender.Nonce += 1
+
// Pay data gas
var dgas int64
for _, byt := range self.data {