From ab37eb797585a82d05d9a2897a0ce3e030815b64 Mon Sep 17 00:00:00 2001 From: Roman Sztergbaum Date: Mon, 27 Jul 2020 11:21:47 +0200 Subject: [PATCH] fix(swaps): first try fixing disappear --- src/atomic.dex.qt.orders.model.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/atomic.dex.qt.orders.model.cpp b/src/atomic.dex.qt.orders.model.cpp index d6ae49bcba..74049c6560 100644 --- a/src/atomic.dex.qt.orders.model.cpp +++ b/src/atomic.dex.qt.orders.model.cpp @@ -307,7 +307,9 @@ namespace atomic_dex data.order_error_state = error.first; data.order_error_message = error.second; } - this->m_swaps_id_registry.emplace(contents.uuid); + if (this->m_swaps_id_registry.find(contents.uuid) == m_swaps_id_registry.end()) { + this->m_swaps_id_registry.emplace(contents.uuid); + } this->m_model_data.push_back(std::move(data)); endInsertRows(); emit lengthChanged(); @@ -333,6 +335,10 @@ namespace atomic_dex update_value(OrdersRoles::OrderErrorStateRole, state, idx, *this); update_value(OrdersRoles::OrderErrorMessageRole, msg, idx, *this); emit lengthChanged(); + } else { + bool is_maker = boost::algorithm::to_lower_copy(contents.type) == "maker"; + spdlog::error("swap with id {} and ticker: {}, not found in the model, cannot update, forcing an initialization instead", contents.uuid, is_maker ? contents.maker_coin : contents.taker_coin); + initialize_swap(contents); } }