aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/command_parser_executor.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-08 16:31:42 -0800
committerRiccardo Spagni <ric@spagni.net>2017-01-08 16:31:42 -0800
commitff1bb6bc6801da46f1fc06b1e177ed53a19acb53 (patch)
tree5fa4c8e59e2598fdac67dcc08ca4f62faffd33c4 /src/daemon/command_parser_executor.cpp
parentMerge pull request #1487 (diff)
parentmake openalias also available for solo miner; introduce namespace tools::dns_... (diff)
downloadmonero-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.cpp32
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)
{