Compare commits

...
1 Commits
Author SHA1 Message Date
Eric Harding fc0a123166 Add guard before unsigned fill math 2019-07-05 16:07:29 -04:00
@@ -107,6 +107,10 @@ void SplitterAlgo::do_update(const api::orderman::Update& update) {
void SplitterAlgo::on_child_change(OrderKey key, ChildState const & state) {
for (auto& child : me->orders) {
if (child.key == key) {
if (state.total_fills < child.state.total_fills) {
algo().cancel("Unexpected fill reduction in fill quantityt");
return;
}
auto delta = state.total_fills.value() - child.state.total_fills.value();
if (delta != 0) {
me->total_fills = Quantity { me->total_fills.value() + delta };