aboutsummaryrefslogtreecommitdiff
path: root/src/common/dns_utils.cpp
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2017-03-17 08:04:17 +0900
committerstoffu <stoffu@protonmail.ch>2017-03-17 10:42:10 +0900
commit250c4cb3e08375f88942f46a3939d050d5c9ebd2 (patch)
tree701896339785cbb8e4235a26c4a55e0e5abd5933 /src/common/dns_utils.cpp
parentMerge pull request #1869 (diff)
downloadmonero-250c4cb3e08375f88942f46a3939d050d5c9ebd2.tar.xz
wallet-rpc: enable openalias
Diffstat (limited to '')
-rw-r--r--src/common/dns_utils.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index 7faf74dd8..ab38cbbae 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -405,21 +405,23 @@ std::vector<std::string> addresses_from_url(const std::string& url, bool& dnssec
return addresses;
}
-std::string get_account_address_as_str_from_url(const std::string& url, bool& dnssec_valid)
+std::string get_account_address_as_str_from_url(const std::string& url, bool& dnssec_valid, bool cli_confirm)
{
// attempt to get address from dns query
auto addresses = addresses_from_url(url, dnssec_valid);
if (addresses.empty())
{
- std::cout << tr("wrong address: ") << url;
+ LOG_ERROR("wrong address: " << url);
return {};
}
// for now, move on only if one address found
if (addresses.size() > 1)
{
- std::cout << tr("not yet supported: Multiple Monero addresses found for given URL: ") << url;
+ LOG_ERROR("not yet supported: Multiple Monero addresses found for given URL: " << url);
return {};
}
+ if (!cli_confirm)
+ return addresses[0];
// prompt user for confirmation.
// inform user of DNSSEC validation status as well.
std::string dnssec_str;