This commit is contained in:
aozhiwei 2024-09-24 17:02:45 +08:00
parent 26be80a811
commit 10d4f3ad8a

View File

@ -61,6 +61,9 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
}
bnOldVal, _ := new(big.Int).SetString(ds.GetByName(valField), 10)
bnVal, _ := new(big.Int).SetString(val, 10)
if bnOldVal == nil {
bnOldVal = new(big.Int)
}
bnNewVal := bnOldVal.Add(bnOldVal, bnVal)
updateKv = append(updateKv, [][]string{{valField, bnNewVal.String()}}...)