Merged with master
This commit is contained in:
commit
4febc07aa0
68 files changed
+1712
-673
No files matched your search
@@ -292,7 +292,7 @@ void NativeOrder::warm_up_activate(OrderServicesData&data, OrderServices& servic
|
||||
}
|
||||
|
||||
|
||||
void NativeOrder::_on_activate(Price p, Quantity q,
|
||||
bool NativeOrder::_on_activate(Price p, Quantity q,
|
||||
bts::orderman::OrderServices &services) {
|
||||
me->state.set_price(p.value());
|
||||
me->state.set_quantity(q.value());
|
||||
@@ -312,7 +312,7 @@ void NativeOrder::_on_activate(Price p, Quantity q,
|
||||
"Dropping order {}",
|
||||
key().value());
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK, "Exchange gateway is down");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// can we trade?
|
||||
@@ -328,7 +328,7 @@ void NativeOrder::_on_activate(Price p, Quantity q,
|
||||
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
fmt::format("Unauthorized order: {}", lqr.error_msg));
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// can we trade this security, with this size?
|
||||
@@ -345,7 +345,7 @@ void NativeOrder::_on_activate(Price p, Quantity q,
|
||||
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
fmt::format("Order would breach limit: {}", lqr.error_msg));
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// are we under the messaging threshold?
|
||||
@@ -356,7 +356,7 @@ void NativeOrder::_on_activate(Price p, Quantity q,
|
||||
key().value());
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
"Messaging threshold breached");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// if we are here we are good.
|
||||
@@ -395,6 +395,7 @@ void NativeOrder::_on_activate(Price p, Quantity q,
|
||||
auto const &ts = services.get_time_str();
|
||||
me->create_transact_time_bm = encoding.overwrite(
|
||||
me->create_transact_time_bm, &ts.value()[0], ts.value().size());
|
||||
return true;
|
||||
}
|
||||
|
||||
OrderOpResult NativeOrder::on_activate(Price p, Quantity q,
|
||||
@@ -409,7 +410,7 @@ OrderOpResult NativeOrder::on_activate(Price p, Quantity q,
|
||||
services.log_scope("NativeOrder::on_activate", key().value());
|
||||
|
||||
// this is a brand new order
|
||||
_on_activate(p,q,services);
|
||||
if (_on_activate(p,q,services)) {
|
||||
me->services->queue_fix(*me->session_services,
|
||||
jetfix::MessageTypes::NewOrderSingle,
|
||||
me->create_encoding);
|
||||
@@ -421,6 +422,8 @@ OrderOpResult NativeOrder::on_activate(Price p, Quantity q,
|
||||
key().value());
|
||||
// early return so we skip the expensive report_state() call
|
||||
return OrderOpResult{};
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// all cases below are for orders recovered from disk
|
||||
|
||||
Reference in new issue
Block a user