• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版6ce51ce2b8c51cf04d6f5bfc83a8662d5ba7596f (tree)
时间2020-03-30 19:13:11
作者Poseidon <shenao.78@163....>
CommiterGitHub

Log Message

fix_check_isPartialTrade (#525)

更改概述

差异

--- a/application/mov/match/engine.go
+++ b/application/mov/match/engine.go
@@ -157,8 +157,9 @@ func addMatchTxOutput(txData *types.TxData, orders []*common.Order, receivedAmou
157157 receivedAmount := receivedAmounts[i].Amount
158158 shouldPayAmount := calcShouldPayAmount(receivedAmount, contractArgs.RatioNumerator, contractArgs.RatioDenominator)
159159
160+ requestAmount := CalcRequestAmount(order.Utxo.Amount, order.RatioNumerator, order.RatioDenominator)
160161 exchangeAmount := order.Utxo.Amount - shouldPayAmount
161- isPartialTrade := CalcRequestAmount(exchangeAmount, contractArgs.RatioNumerator, contractArgs.RatioDenominator) >= 1
162+ isPartialTrade := requestAmount > receivedAmount && CalcRequestAmount(exchangeAmount, contractArgs.RatioNumerator, contractArgs.RatioDenominator) >= 1
162163
163164 setMatchTxArguments(txData.Inputs[i], isPartialTrade, len(txData.Outputs), receivedAmount)
164165 txData.Outputs = append(txData.Outputs, types.NewIntraChainOutput(*order.ToAssetID, allocatedAssets.Receives[i].Amount, contractArgs.SellerProgram))
Show on old repository browser