Browse Source

Taker removes order from feed after cfd insert

We have a 1:1 relationship (and the fact that we don't remove cfds) between cfd and order at the moment, so once the cfd was inserted we cannot creat another cfd for the same order.
Thus, we should remove the order from the feel by sending `None`.
hotfix/0.1.1
Daniel Karzel 3 years ago
parent
commit
dfc8b00ac7
No known key found for this signature in database GPG Key ID: 30C3FC2E438ADB6E
  1. 5
      daemon/src/taker_cfd.rs

5
daemon/src/taker_cfd.rs

@ -155,6 +155,11 @@ impl<O, M> Actor<O, M> {
insert_cfd(&cfd, &mut conn, &self.cfd_feed_actor_inbox).await?;
// Cleanup own order feed, after inserting the cfd.
// Due to the 1:1 relationship between order and cfd we can never create another cfd for the
// same order id.
self.order_feed_actor_inbox.send(None)?;
self.send_to_maker
.do_send(wire::TakerToMaker::TakeOrder { order_id, quantity })?;

Loading…
Cancel
Save