}
refoundAmount := map[bc.AssetID]uint64{}
+ assetIDs := []bc.AssetID{}
refoundScript := [][]byte{}
for _, input := range txData.Inputs {
refoundAmount[input.AssetID()] += input.Amount()
return err
}
+ assetIDs = append(assetIDs, input.AssetID())
refoundScript = append(refoundScript, contractArgs.SellerProgram)
}
}
refoundCount := len(refoundScript)
- for assetID, amount := range refoundAmount {
+ for _, assetID := range assetIDs {
+ amount := refoundAmount[assetID]
averageAmount := amount / uint64(refoundCount)
if averageAmount == 0 {
averageAmount = 1