Skip to content

Commit

Permalink
Simple idea for cancel take (#331)
Browse files Browse the repository at this point in the history
* idea for cancel take

* fix cancel command for sell order

* fix typo

* removed wrong part of old PR
  • Loading branch information
arkanoider authored Jul 19, 2024
1 parent e7aeb9e commit eace323
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub async fn cancel_action(
return Ok(());
}
};

if order.status == Status::Pending.to_string() {
let user_pubkey = event.pubkey.to_string();
// Validates if this user is the order creator
Expand All @@ -54,7 +55,8 @@ pub async fn cancel_action(
}

if order.kind == OrderKind::Sell.to_string()
&& order.status == Status::WaitingBuyerInvoice.to_string()
&& (order.status == Status::WaitingBuyerInvoice.to_string()
|| order.status == Status::WaitingBuyerInvoice.to_string())
{
cancel_add_invoice(ln_client, &mut order, event, pool, my_keys).await?;
}
Expand Down Expand Up @@ -162,8 +164,6 @@ pub async fn cancel_add_invoice(
if let Some(hash) = &order.hash {
ln_client.cancel_hold_invoice(hash).await?;
info!("Order Id {}: Funds returned to seller", &order.id);
} else {
return Err(Error::msg("No hash present"));
}

let user_pubkey = event.pubkey.to_string();
Expand Down

0 comments on commit eace323

Please sign in to comment.