Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ktop into dev
  • Loading branch information
smk762 committed Sep 22, 2023
2 parents de26806 + a66cc3a commit 6061aa6
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions src/core/atomicdex/services/mm2/mm2.service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,36 +1298,27 @@ namespace atomic_dex
std::size_t limit = 5000;
bool requires_v2 = false;
std::string method = "my_tx_history";
if (coin_info.coin_type == CoinTypeGadget::SLP || coin_info.ticker == "tBCH" || coin_info.ticker == "BCH")
if (coin_info.coin_type == CoinTypeGadget::ZHTLC || coin_info.coin_type == CoinTypeGadget::TENDERMINT || coin_info.coin_type == CoinTypeGadget::TENDERMINTTOKEN || coin_info.coin_type == CoinTypeGadget::SLP || coin_info.ticker == "tBCH" || coin_info.ticker == "BCH")
{
requires_v2 = true;
t_tx_history_request request{.coin = ticker, .limit = limit};
nlohmann::json j = mm2::template_request(method, requires_v2);
mm2::to_json(j, request);
batch_array.push_back(j);
}
else if (coin_info.is_zhtlc_family)
{
// Don't request balance / history if not completely activated.
if (coin_info.activation_status.at("result").at("status") == "Ok")
if (coin_info.is_zhtlc_family)
{
limit = 50;
requires_v2 = true;
method = "z_coin_tx_history";
t_tx_history_request request{.coin = ticker, .limit = limit};
nlohmann::json j = mm2::template_request(method, requires_v2);
mm2::to_json(j, request);
batch_array.push_back(j);
// Don't request balance / history if not completely activated.
if (coin_info.activation_status.at("result").at("status") == "Ok")
{
limit = 50;
method = "z_coin_tx_history";
}
else
{
return std::make_tuple(batch_array, tickers_idx, tokens_to_fetch);
}
}
}
else
{
t_tx_history_request request{.coin = ticker, .limit = limit};
nlohmann::json j = mm2::template_request(method, requires_v2);
mm2::to_json(j, request);
batch_array.push_back(j);
}

t_tx_history_request request{.coin = ticker, .limit = limit};
nlohmann::json j = mm2::template_request(method, requires_v2);
mm2::to_json(j, request);
batch_array.push_back(j);
}

if (not only_tx)
Expand Down

0 comments on commit 6061aa6

Please sign in to comment.