Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qlu committed Sep 30, 2019
1 parent 0560c34 commit 38e50bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion core/cpp/wingchun/include/kungfu/wingchun/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ namespace kungfu
{
uint64_t parent_id; //母订单ID
uint64_t order_id; //订单ID
uint64_t external_id;

int64_t insert_time; //订单写入时间
int64_t update_time; //订单更新时间
Expand Down
9 changes: 3 additions & 6 deletions core/extensions/xtp/src/trader_xtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,16 @@ namespace kungfu
auto writer = get_writer(event->source());
msg::data::Order &order = writer->open_data<msg::data::Order>(event->gen_time(), msg::type::Order);
order_from_input(input, order);
strcpy(order.trading_day, trading_day_.c_str());
order.insert_time = nano;
order.update_time = nano;
if (xtp_order_id == 0)
{
order.insert_time = nano;
order.update_time = nano;
strcpy(order.trading_day, trading_day_.c_str());

XTPRI *error_info = api_->GetApiLastError();
order.error_id = error_info->error_id;
strncpy(order.error_msg, error_info->error_msg, ERROR_MSG_LEN);
order.status = OrderStatus::Error;

writer->close_data();

INSERT_ORDER_ERROR(
fmt::format("(input){}(ErrorId){}, (ErrorMsg){}", to_string(xtp_input), error_info->error_id, error_info->error_msg));
return false;
Expand Down

0 comments on commit 38e50bb

Please sign in to comment.