From 545407d960070ec2edbd95efbcb985d4b3b10cf6 Mon Sep 17 00:00:00 2001 From: paladz <453256728@qq.com> Date: Wed, 25 Mar 2020 22:37:18 +0800 Subject: [PATCH] add for fix --- application/mov/match/engine.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/mov/match/engine.go b/application/mov/match/engine.go index 5f407834..ad6fd1f8 100644 --- a/application/mov/match/engine.go +++ b/application/mov/match/engine.go @@ -68,6 +68,7 @@ func (e *Engine) addMatchTxFeeOutput(txData *types.TxData, fees []*bc.AssetAmoun } refoundAmount := map[bc.AssetID]uint64{} + assetIDs := []bc.AssetID{} refoundScript := [][]byte{} for _, input := range txData.Inputs { refoundAmount[input.AssetID()] += input.Amount() @@ -76,6 +77,7 @@ func (e *Engine) addMatchTxFeeOutput(txData *types.TxData, fees []*bc.AssetAmoun return err } + assetIDs = append(assetIDs, input.AssetID()) refoundScript = append(refoundScript, contractArgs.SellerProgram) } @@ -85,7 +87,8 @@ func (e *Engine) addMatchTxFeeOutput(txData *types.TxData, fees []*bc.AssetAmoun } refoundCount := len(refoundScript) - for assetID, amount := range refoundAmount { + for _, assetID := range assetIDs { + amount := refoundAmount[assetID] averageAmount := amount / uint64(refoundCount) if averageAmount == 0 { averageAmount = 1 -- 2.11.0