File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -1645,22 +1645,19 @@ impl TakerOrder {
16451645 return MatchReservedResult :: NotMatched ;
16461646 }
16471647
1648- if self . request . swap_version . is_legacy ( ) || reserved. swap_version . is_legacy ( ) {
1649- if my_rel_amount <= other_base_amount {
1650- MatchReservedResult :: Matched
1651- } else {
1652- MatchReservedResult :: NotMatched
1653- }
1648+ let other_base_amount = if self . request . swap_version . is_legacy ( ) || reserved. swap_version . is_legacy ( ) {
1649+ other_base_amount. clone ( )
16541650 } else {
16551651 let premium = & reserved. premium . clone ( ) . unwrap_or_default ( ) ;
16561652 let other_price = & ( my_base_amount - premium) / other_base_amount;
16571653 // In match_with_request function, we allowed maker to send fewer coins for taker sell action
1658- let result_other_base_amount = other_base_amount + & ( premium / & other_price) ;
1659- if my_rel_amount <= & result_other_base_amount {
1660- MatchReservedResult :: Matched
1661- } else {
1662- MatchReservedResult :: NotMatched
1663- }
1654+ other_base_amount + & ( premium / & other_price)
1655+ } ;
1656+
1657+ if my_rel_amount <= & other_base_amount {
1658+ MatchReservedResult :: Matched
1659+ } else {
1660+ MatchReservedResult :: NotMatched
16641661 }
16651662 } ,
16661663 }
You can’t perform that action at this time.
0 commit comments