diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-08 16:31:42 -0800 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-08 16:31:42 -0800 |
commit | ff1bb6bc6801da46f1fc06b1e177ed53a19acb53 (patch) | |
tree | 5fa4c8e59e2598fdac67dcc08ca4f62faffd33c4 /src/daemon/command_parser_executor.cpp | |
parent | Merge pull request #1487 (diff) | |
parent | make openalias also available for solo miner; introduce namespace tools::dns_... (diff) | |
download | monero-ff1bb6bc6801da46f1fc06b1e177ed53a19acb53.tar.xz |
Merge pull request #1460
99580adf make openalias also available for solo miner; introduce namespace tools::dns_utils; support integrated address with dns lookup (kenshi84)
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index f07ef1616..7381dd06f 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -26,7 +26,7 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "cryptonote_core/cryptonote_basic_impl.h" +#include "common/dns_utils.h" #include "daemon/command_parser_executor.h" namespace daemonize { @@ -238,17 +238,35 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg } cryptonote::account_public_address adr; + bool has_payment_id; + crypto::hash8 payment_id; bool testnet = false; - if(!cryptonote::get_account_address_from_str(adr, false, args.front())) + if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, false, args.front())) { - if(!cryptonote::get_account_address_from_str(adr, true, args.front())) + if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, true, args.front())) { - std::cout << "target account address has wrong format" << std::endl; - return true; + bool dnssec_valid; + std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(args.front(), dnssec_valid); + if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, false, address_str)) + { + if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, true, address_str)) + { + std::cout << "target account address has wrong format" << std::endl; + return true; + } + else + { + testnet = true; + } + } + } + else + { + testnet = true; } - testnet = true; - std::cout << "Mining to a testnet address, make sure this is intentional!" << std::endl; } + if(testnet) + std::cout << "Mining to a testnet address, make sure this is intentional!" << std::endl; uint64_t threads_count = 1; if(args.size() > 2) { |