OSDN Git Service

fix validate fee
authorshenao78 <shenao.78@163.com>
Mon, 20 Jul 2020 07:12:00 +0000 (15:12 +0800)
committershenao78 <shenao.78@163.com>
Mon, 20 Jul 2020 07:12:00 +0000 (15:12 +0800)
application/mov/match/fee_strategy.go
application/mov/mov_core.go

index 0c74c90..87e0d90 100644 (file)
@@ -72,7 +72,7 @@ func (d *DefaultFeeStrategy) Validate(receiveAmounts []*bc.AssetAmount, feeAmoun
        for _, receiveAmount := range receiveAmounts {
                realFeeAmount := feeAmounts[*receiveAmount.AssetId]
                feeAmount := d.calcFeeAmount(receiveAmount.Amount, false)
-               if realFeeAmount > feeAmount {
+               if realFeeAmount < feeAmount {
                        return ErrInvalidAmountOfFee
                }
        }
index 3ada693..d7dc2df 100644 (file)
@@ -331,7 +331,7 @@ func validateMatchedTxFee(tx *types.Tx, blockHeight uint64) error {
                return err
        }
 
-       receivedAmount, _ := match.CalcReceivedAmount(orders)
+       receivedAmount, priceDiffs := match.CalcReceivedAmount(orders)
        feeAmounts := make(map[bc.AssetID]uint64)
        for assetID, fee := range matchedTxFees {
                feeAmounts[assetID] = fee.amount