From 2cfbd655cbdef732ba351c23b11aba1a77ba57b9 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Mon, 19 Nov 2018 15:43:44 +0000 Subject: [PATCH] Trimmed account name from fill record. At some point in the past this was saved with spaces to the side of it, and that messes up matching with the account names. The implicit assumption is that we will never want account names with spaces at the end. --- src/lib/orderman/actors/order_manager/OrderManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/orderman/actors/order_manager/OrderManager.cpp b/src/lib/orderman/actors/order_manager/OrderManager.cpp index a827073ff..fe06f382d 100644 --- a/src/lib/orderman/actors/order_manager/OrderManager.cpp +++ b/src/lib/orderman/actors/order_manager/OrderManager.cpp @@ -15,6 +15,7 @@ #include #include +#include namespace bts { namespace orderman { @@ -123,10 +124,11 @@ void OrderManager::on_fill_recovery( update.events->size()); me->state = State::WAIT_ORDERS; - for (auto const &ev : *(update.events)) - me->services_data.limiter.add(*ev.security, ev.fill.account(), - ev.fill.side(), + for (auto const &ev : *(update.events)) { + auto trimmed_account_name = boost::algorithm::trim_copy(ev.fill.account()); + me->services_data.limiter.add(*ev.security, trimmed_account_name,ev.fill.side(), Quantity(ev.fill.last_shares())); + } me->stored_order_sub = subscribe( [this](auto const &orders) { this->on_order_recovery(orders); });