• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版664c0fe92520a40bf327d8e745d581f2b3582d77 (tree)
时间2020-03-25 23:46:48
作者paladz <453256728@qq.c...>
Commiterpaladz

Log Message

elegant the code

更改概述

差异

--- a/application/mov/match/engine.go
+++ b/application/mov/match/engine.go
@@ -206,10 +206,7 @@ func CalcReceivedAmount(orders []*common.Order) ([]*bc.AssetAmount, []*bc.AssetA
206206
207207 for i, receivedAmount := range receivedAmounts {
208208 oppositeShouldPayAmount := shouldPayAmounts[calcOppositeIndex(len(orders), i)]
209- priceDiffs = append(priceDiffs, &bc.AssetAmount{AssetId: oppositeShouldPayAmount.AssetId, Amount: 0})
210- if oppositeShouldPayAmount.Amount > receivedAmount.Amount {
211- priceDiffs[i].Amount = oppositeShouldPayAmount.Amount - receivedAmount.Amount
212- }
209+ priceDiffs = append(priceDiffs, &bc.AssetAmount{AssetId: oppositeShouldPayAmount.AssetId, Amount: oppositeShouldPayAmount.Amount - receivedAmount.Amount})
213210 }
214211 return receivedAmounts, priceDiffs
215212 }
Show on old repository browser