SPARK-1234, Make sure rejected orders have valid price, quantity

This commit is contained in:
Pedro Pinto committed 2018-06-12 17:04:29 -04:00
1 parent 027e434ac9
commit 508e2d4fcf
1 file changed
+6 -5
@@ -277,6 +277,12 @@ void NativeOrder::on_activate(Price p, Quantity q,
case ORDER_STATUS_INACTIVE: {
// this is a brand new order
me->state.set_price(p.value());
me->state.set_quantity(q.value());
me->state.set_filled_quantity(0);
me->state.set_last_price(0);
me->state.set_avg_price(0);
me->session_services = &me->services->get_session_services(
get_native_state(me->state).routing_record().session());
me->price_encoding_precision =
@@ -378,11 +384,6 @@ void NativeOrder::on_activate(Price p, Quantity q,
me->session_services->send_fix_buffer(cid, buffer);
me->state.set_status(ORDER_STATUS_PENDING_WORKING);
me->state.set_price(p.value());
me->state.set_quantity(q.value());
me->state.set_filled_quantity(0);
me->state.set_last_price(0);
me->state.set_avg_price(0);
LOG(OrderMan, Info, "Sent new order with key {} to gateway",
key().value());