Skip to content

Commit

Permalink
fix for issue #320 (#321)
Browse files Browse the repository at this point in the history
* fix for issue #320

* fix: prevents the creation of an order with inverted min & max amounts (#322)

---------

Co-authored-by: Bilthon <bilthon@gmail.com>
  • Loading branch information
arkanoider and bilthon authored Jul 9, 2024
1 parent 46a617d commit 4d777ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ pub async fn order_action(
// Get max and and min amount in case of range order
// in case of single order do like usual
if let (Some(min), Some(max)) = (order.min_amount, order.max_amount) {
if min >= max {
let msg = format!("Min amount is greater than max amount");
send_cant_do_msg(order.id, Some(msg), &event.pubkey).await;
return Ok(());
}
if order.amount == 0 {
amount_vec.clear();
amount_vec.push(min);
Expand Down

0 comments on commit 4d777ba

Please sign in to comment.