Allow cover order to continue even if hedgding child is canceled.

This commit is contained in:
Pedro Pinto committed 2019-06-14 10:44:38 -04:00
1 parent 0af5b78318
commit 3dda3e7f75
1 file changed
+1 -6
@@ -134,17 +134,12 @@ void CoverAlgo::on_child_change(OrderKey k, ChildState const &st) {
switch (st.status) {
case ChildStatus::WORKING:
break;
case ChildStatus::CANCELED:
case ChildStatus::COMPLETED:
if (auto it = std::find(me->hedges.begin(), me->hedges.end(), k);
it != me->hedges.end())
me->hedges.erase(it);
break;
case ChildStatus::CANCELED:
LOG(OrderMan, Info, "CoverAlgo {}. Hedge was canceled, terminating",
algo().order_key().value());
me->status = Status::DONE;
algo().terminate_error("Unexpected child cancel");
break;
}
}
check_terminate();