Skip to content

Commit

Permalink
Mark cancelled order as completed, but allow offer rejection after co…
Browse files Browse the repository at this point in the history
…mpletion
  • Loading branch information
nobu-maeda committed Apr 24, 2024
1 parent 8b40cd3 commit b5962e3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/maker/maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,6 @@ impl MakerActor {
trade_rsp: TradeResponse,
rsp_tx: oneshot::Sender<Result<(), N3xbError>>,
) {
if let Some(error) = self.check_trade_completed().err() {
rsp_tx.send(Err(error)).unwrap(); // oneshot should not fail
return;
}

let offer_event_id = trade_rsp.offer_event_id.clone();

let pubkey = match self.data.offer_envelopes().get(&offer_event_id) {
Expand Down Expand Up @@ -573,6 +568,8 @@ impl MakerActor {
.delete_maker_order_note(maker_order_note_id.clone(), "Trade Cancelled")
.await;

self.data.set_trade_completed(true);

// Send response back to user
match result {
Ok(_) => {
Expand Down

0 comments on commit b5962e3

Please sign in to comment.