Fix step limit check for patch transaction
@@ -225,6 +225,7 @@ func (tx *transactionV3) ValidateNetwork(nid int) bool {
}
func (tx *transactionV3) PreValidate(wc state.WorldContext, update bool) error {
+ if tx.DataType == nil || *tx.DataType != DataTypePatch {
// stepLimit >= default step + input steps
cnt, err := MeasureBytesOfData(wc.Revision(), tx.Data)
if err != nil {
@@ -234,6 +235,7 @@ func (tx *transactionV3) PreValidate(wc state.WorldContext, update bool) error {
if tx.StepLimit.Cmp(minStep) < 0 {
return NotEnoughStepError.Errorf("NotEnoughStep(txStepLimit:%s, minStep:%s)", tx.StepLimit, minStep)
}
+ }
// balance >= (fee + value)
stepPrice := wc.StepPrice()
