diff --git a/core/state_transition.go b/core/state_transition.go index a605c03185..d441925b90 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -353,7 +353,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, quotaUsed gu := st.gasUsed() if st.modelGas != nil && len(st.modelGas) > 0 { //pay ctx to the model authors by the model gas * current price for addr, mgas := range st.modelGas { - if int64(mgas) <= 0 || mgas > params.MODEL_GAS_LIMIT { + if int64(mgas) <= 0 || mgas > params.MODEL_GAS_UP_LIMIT { continue } diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 52ef269d86..7d1fb95985 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -248,9 +248,7 @@ func (in *CVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( if modelMeta.Gas == uint64(0) { //modelMeta.SetGas(params.MODEL_GAS_LIMIT) modelMeta.SetGas(0) - } else if modelMeta.Gas > params.MODEL_GAS_UP_LIMIT { - modelMeta.SetGas(params.MODEL_GAS_LIMIT) - } else if modelMeta.Gas < params.MODEL_GAS_LIMIT { + } else if modelMeta.Gas > params.MODEL_GAS_UP_LIMIT{ modelMeta.SetGas(params.MODEL_GAS_LIMIT) } else if int64(modelMeta.Gas) < 0 { modelMeta.SetGas(0)