Skip to content

Commit

Permalink
server/swap: exclude maker address for cancel match
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Nov 11, 2021
1 parent 45782b3 commit 7909ec7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/swap/swap.go
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,13 @@ func matchNotifications(match *matchTracker) (makerMsg *msgjson.Match, takerMsg
// }
// FeeRateMakerSwap := feeRate(match.makerStatus.swapAsset)

// If the taker order is a cancel, omit the maker (trade) order's address
// since it is dead weight. Consider omitting the numeric fields too.
var makerAddr string
if match.Taker.Type() != order.CancelOrderType {
makerAddr = order.ExtractAddress(match.Maker)
}

stamp := encode.UnixMilliU(match.matchTime)
return &msgjson.Match{
OrderID: idToBytes(match.Maker.ID()),
Expand All @@ -2005,7 +2012,7 @@ func matchNotifications(match *matchTracker) (makerMsg *msgjson.Match, takerMsg
MatchID: idToBytes(match.ID()),
Quantity: match.Quantity,
Rate: match.Rate,
Address: order.ExtractAddress(match.Maker),
Address: makerAddr,
ServerTime: stamp,
FeeRateBase: match.FeeRateBase,
FeeRateQuote: match.FeeRateQuote,
Expand Down

0 comments on commit 7909ec7

Please sign in to comment.