diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-02 23:32:02 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-02 23:32:02 +0800 |
commit | b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad (patch) | |
tree | 6af5b54d74402e2c31ea083981d215c0701832f4 /core/state_transition.go | |
parent | 73c52d1677ba526385f1b223ef48f3a26091fe00 (diff) | |
download | dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.gz dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.bz2 dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.lz dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.xz dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.zst dexon-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.zip |
New gas prices model
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/state_transition.go b/core/state_transition.go index 7331fdd4a..8626504f9 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -12,6 +12,12 @@ import ( const tryJit = false +var ( + GasTx = big.NewInt(21000) + GasTxNonZeroByte = big.NewInt(37) + GasTxZeroByte = big.NewInt(2) +) + /* * The State transitioning model * @@ -170,7 +176,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) { //sender.Nonce += 1 // Transaction gas - if err = self.UseGas(vm.GasTx); err != nil { + if err = self.UseGas(GasTx); err != nil { return } @@ -178,9 +184,9 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) { var dgas int64 for _, byt := range self.data { if byt != 0 { - dgas += vm.GasData.Int64() + dgas += GasTxNonZeroByte.Int64() } else { - dgas += 1 // This is 1/5. If GasData changes this fails + dgas += GasTxZeroByte.Int64() } } if err = self.UseGas(big.NewInt(dgas)); err != nil { |