Browse Source
We should remove the order as soon as we know that we will create a cfd out of it. The (automated) maker reacts on the state change on the feed and may trigger creating a new order. If we only remove the order at the end the `None` might arrive at the taker after we send the new order. Furthermore, we should always remove the order independent of accept/reject, so this is done only once upon handling the take request now. Note that due to this async nature of the application it can still happen that the taker receives `None` after the new `Some(order)`, but this behaviour becomes less likely and the code is generally more correct. We could also make sending the message to the taker sync, but that might have unwanted, long-blocking side effects.new-http-api
Daniel Karzel
3 years ago
1 changed files with 14 additions and 23 deletions
Loading…
Reference in new issue