Skip to content

Commit

Permalink
Missed shutdown removal from Takers
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-maeda committed Apr 1, 2024
1 parent f61ed26 commit e5bc2a0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/taker/taker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl TakerActor {
self.send_peer_message(message, rsp_tx).await;
}
TakerRequest::TradeComplete { rsp_tx } => {
terminate = self.trade_complete(rsp_tx);
self.trade_complete(rsp_tx);
}
TakerRequest::RegisterNotifTx { tx, rsp_tx } => {
self.register_notif_tx(tx, rsp_tx);
Expand Down Expand Up @@ -383,16 +383,15 @@ impl TakerActor {
}
}

fn trade_complete(&mut self, rsp_tx: oneshot::Sender<Result<(), N3xbError>>) -> bool {
fn trade_complete(&mut self, 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 false;
return;
}

// TODO: What else to do for Trade Complete?
self.data.set_trade_completed(true);
rsp_tx.send(Ok(())).unwrap();
return true;
}

fn shutdown(&mut self, rsp_tx: oneshot::Sender<Result<(), N3xbError>>) {
Expand Down

0 comments on commit e5bc2a0

Please sign in to comment.