Skip to content

Commit 6061aa6

Browse files
committed
2 parents de26806 + a66cc3a commit 6061aa6

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

src/core/atomicdex/services/mm2/mm2.service.cpp

+16-25
Original file line numberDiff line numberDiff line change
@@ -1298,36 +1298,27 @@ namespace atomic_dex
12981298
std::size_t limit = 5000;
12991299
bool requires_v2 = false;
13001300
std::string method = "my_tx_history";
1301-
if (coin_info.coin_type == CoinTypeGadget::SLP || coin_info.ticker == "tBCH" || coin_info.ticker == "BCH")
1301+
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")
13021302
{
13031303
requires_v2 = true;
1304-
t_tx_history_request request{.coin = ticker, .limit = limit};
1305-
nlohmann::json j = mm2::template_request(method, requires_v2);
1306-
mm2::to_json(j, request);
1307-
batch_array.push_back(j);
1308-
}
1309-
else if (coin_info.is_zhtlc_family)
1310-
{
1311-
// Don't request balance / history if not completely activated.
1312-
if (coin_info.activation_status.at("result").at("status") == "Ok")
1304+
if (coin_info.is_zhtlc_family)
13131305
{
1314-
limit = 50;
1315-
requires_v2 = true;
1316-
method = "z_coin_tx_history";
1317-
t_tx_history_request request{.coin = ticker, .limit = limit};
1318-
nlohmann::json j = mm2::template_request(method, requires_v2);
1319-
mm2::to_json(j, request);
1320-
batch_array.push_back(j);
1306+
// Don't request balance / history if not completely activated.
1307+
if (coin_info.activation_status.at("result").at("status") == "Ok")
1308+
{
1309+
limit = 50;
1310+
method = "z_coin_tx_history";
1311+
}
1312+
else
1313+
{
1314+
return std::make_tuple(batch_array, tickers_idx, tokens_to_fetch);
1315+
}
13211316
}
13221317
}
1323-
else
1324-
{
1325-
t_tx_history_request request{.coin = ticker, .limit = limit};
1326-
nlohmann::json j = mm2::template_request(method, requires_v2);
1327-
mm2::to_json(j, request);
1328-
batch_array.push_back(j);
1329-
}
1330-
1318+
t_tx_history_request request{.coin = ticker, .limit = limit};
1319+
nlohmann::json j = mm2::template_request(method, requires_v2);
1320+
mm2::to_json(j, request);
1321+
batch_array.push_back(j);
13311322
}
13321323

13331324
if (not only_tx)

0 commit comments

Comments
 (0)