Skip to content

Commit

Permalink
ud: increase bridge timeout to 10s, use right property for address
Browse files Browse the repository at this point in the history
  • Loading branch information
hayzamjs committed Jan 25, 2023
1 parent 8dae44c commit fefb356
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/common/dns_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ std::string get_account_address_as_str_from_url(const std::string& url, bool& dn
}

else {
std::vector<std::string> addresses;
std::vector<std::string> ud_addresses;
std::string ud_bridge_api = "http://ud-bridge.scalaproject.io/fetch-records/" + url;

Expand All @@ -530,7 +531,7 @@ std::string get_account_address_as_str_from_url(const std::string& url, bool& dn
const epee::net_utils::http::http_response_info *info = NULL;


if (!client.invoke_get(u_c.uri, std::chrono::seconds(5), "", &info, fields)){
if (!client.invoke_get(u_c.uri, std::chrono::seconds(10), "", &info, fields)){
LOG_ERROR(ud_bridge_api << " is not responding, skipping.");
return {};
} else{
Expand All @@ -553,18 +554,14 @@ std::string get_account_address_as_str_from_url(const std::string& url, bool& dn
return {};
}

if (!doc["records"].HasMember("records")){
LOG_ERROR("Failed to get records from " << ud_bridge_api << ", skipping.");
return {};
}

if (!doc["records"]["records"].HasMember("crypto.XMR.address")){
if (!doc["records"].HasMember("crypto.XLA.address")){
LOG_ERROR("Failed to get XLA address from " << ud_bridge_api << ", skipping.");
return {};
} else {
std::string address = doc["records"]["records"]["crypto.XMR.address"].GetString();
std::string address = doc["records"]["crypto.XLA.address"].GetString();

return address;
addresses.push_back(address);
return dns_confirm(url, addresses, true);
}
}
}
Expand Down

0 comments on commit fefb356

Please sign in to comment.