diff --git a/src/lib/orderman/orders/NativeOrder.cpp b/src/lib/orderman/orders/NativeOrder.cpp index b07e9049f..5a7f9988c 100644 --- a/src/lib/orderman/orders/NativeOrder.cpp +++ b/src/lib/orderman/orders/NativeOrder.cpp @@ -30,7 +30,7 @@ struct NativeOrder::PImpl { PImpl() : services(nullptr), session_services(), sec(nullptr), previous_position_contribution(0), definition(), state(), - price_encoding_precision(7), have_exchange_order_id(false) {} + price_encoding_precision(7), received_exchanged_order_id(false) {} OrderServices *services; SessionServices *session_services; @@ -41,7 +41,7 @@ struct NativeOrder::PImpl { OrderDefinition definition; OrderState state; int price_encoding_precision; - bool have_exchange_order_id; + bool received_exchanged_order_id; jetfix::FIXFragment update_encoding; jetfix::FIXFragment::Bookmark update_price_bm; @@ -703,7 +703,7 @@ void NativeOrder::on_exe_report(const NewExecutionReportEvent &er) { native_state.set_native_status(er.data->order_status); native_state.set_native_type(er.data->order_type); - bool got_first_exchange_order_id = !me->have_exchange_order_id; + bool got_first_exchange_order_id = !me->received_exchanged_order_id; if (got_first_exchange_order_id) { auto ts = to_trim_str(er.data->exchange_order_id.value()); native_state.set_exchange_order_id(std::string(ts.first, ts.second)); @@ -752,7 +752,6 @@ void NativeOrder::on_exe_report(const NewExecutionReportEvent &er) { // reported once, since they are both immutable, so we clear them // after their first report to make subsquent state updates faster if (got_first_exchange_order_id) { - me->have_exchange_order_id = true; native_state.clear_exchange_order_id(); native_state.mutable_routing_record()->Clear(); } @@ -1003,6 +1002,7 @@ void NativeOrder::add_exchange_order_id_to_fix() { me->update_encoding.add(eoid); me->cancel_encoding.add(eoid); + me->received_exchanged_order_id = true; } OrderStatus map_external_status(NativeOrderStatus status) {