Fix problem on out of balance in fee in transaction v2
If the balance is not enough to pay the fee of transaction v2,
it sets the step price to zero for the transaction.
But it changes the price of the step for v2.
@@ -19,6 +19,7 @@ import (
var version2FixedFee = big.NewInt(10 * state.PETA)
var version2StepPrice = big.NewInt(10 * state.GIGA)
var version2StepUsed = big.NewInt(1000000)
+var version2ZeroPrice = new(big.Int)
type transactionV2 struct {
*transactionJSON
@@ -149,7 +150,7 @@ func (tx *transactionV2) Execute(ctx contract.Context, estimate bool) (txresult.
if bal1.Cmp(trans) < 0 {
stepPrice := version2StepPrice
if bal1.Cmp(version2FixedFee) < 0 {
- stepPrice.SetInt64(0)
+ stepPrice = version2ZeroPrice
}
r.SetResult(module.StatusOutOfBalance, version2StepUsed, stepPrice, nil)
return r, nil
