diff options
author | Thomas Winget <tewinget@gmail.com> | 2014-09-17 17:38:54 -0400 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-23 22:58:28 +0200 |
commit | c14c7e16839b6cfe32527f2b01a9a1507e3d419e (patch) | |
tree | 519980c3d1e09f7e29ae6002d30d0126f1b4a8c4 /src/simplewallet/simplewallet.cpp | |
parent | Simplewallet should now resolve urls to addresses (diff) | |
download | monero-c14c7e16839b6cfe32527f2b01a9a1507e3d419e.tar.xz |
change to allow (at least a bit) for multiple TXT records
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 07b2f7935..e2564236b 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -913,16 +913,15 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_) { // if treating as an address fails, try as url bool dnssec_ok = false; - std::string addr_from_dns; std::string url = local_args[i]; // attempt to get address from dns query - addr_from_dns = tools::wallet2::address_from_url(url, dnssec_ok); + auto addresses_from_dns = tools::wallet2::addresses_from_url(url, dnssec_ok); - // if string not empty, see if it's an address - if (addr_from_dns.size()) + // for now, move on only if one address found + if (addresses_from_dns.size() == 1) { - if (get_account_address_from_str(de.addr, addr_from_dns)) + if (get_account_address_from_str(de.addr, addresses_from_dns[0])) { // if it was an address, prompt user for confirmation. // inform user of DNSSEC validation status as well. @@ -938,8 +937,8 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_) } std::stringstream prompt; prompt << "For URL: " << url - << "," << dnssec_str - << " Monero Address = " << addr_from_dns + << "," << dnssec_str << std::endl + << " Monero Address = " << addresses_from_dns[0] << std::endl << "Is this OK? (Y/n) " ; @@ -958,6 +957,10 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_) return true; } } + else if (addresses_from_dns.size() > 1) + { + tools::fail_msg_writer() << "Multiple Monero addresses found for given URL: " << url << ", this is not yet supported."; + } else { fail_msg_writer() << "wrong address: " << local_args[i]; |