aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/command_parser_executor.cpp19
-rw-r--r--src/daemon/rpc_command_executor.cpp2
2 files changed, 12 insertions, 9 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index af46453cd..50a63d955 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -252,20 +252,18 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
return true;
}
- cryptonote::account_public_address adr;
- bool has_payment_id;
- crypto::hash8 payment_id;
+ cryptonote::address_parse_info info;
bool testnet = false;
- if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, false, args.front()))
+ if(!cryptonote::get_account_address_from_str(info, false, args.front()))
{
- if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, true, args.front()))
+ if(!cryptonote::get_account_address_from_str(info, true, args.front()))
{
bool dnssec_valid;
std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(args.front(), dnssec_valid,
[](const std::string &url, const std::vector<std::string> &addresses, bool dnssec_valid){return addresses[0];});
- if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, false, address_str))
+ if(!cryptonote::get_account_address_from_str(info, false, address_str))
{
- if(!cryptonote::get_account_integrated_address_from_str(adr, has_payment_id, payment_id, true, address_str))
+ if(!cryptonote::get_account_address_from_str(info, true, address_str))
{
std::cout << "target account address has wrong format" << std::endl;
return true;
@@ -281,6 +279,11 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
testnet = true;
}
}
+ if (info.is_subaddress)
+ {
+ tools::fail_msg_writer() << "subaddress for mining reward is not yet supported!" << std::endl;
+ return true;
+ }
if(testnet)
std::cout << "Mining to a testnet address, make sure this is intentional!" << std::endl;
uint64_t threads_count = 1;
@@ -307,7 +310,7 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
threads_count = (ok && 0 < threads_count) ? threads_count : 1;
}
- m_executor.start_mining(adr, threads_count, testnet, do_background_mining, ignore_battery);
+ m_executor.start_mining(info.address, threads_count, testnet, do_background_mining, ignore_battery);
return true;
}
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index ef593237c..be1ed20ba 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -1014,7 +1014,7 @@ bool t_rpc_command_executor::print_transaction_pool_stats() {
bool t_rpc_command_executor::start_mining(cryptonote::account_public_address address, uint64_t num_threads, bool testnet, bool do_background_mining, bool ignore_battery) {
cryptonote::COMMAND_RPC_START_MINING::request req;
cryptonote::COMMAND_RPC_START_MINING::response res;
- req.miner_address = cryptonote::get_account_address_as_str(testnet, address);
+ req.miner_address = cryptonote::get_account_address_as_str(testnet, false, address);
req.threads_count = num_threads;
req.do_background_mining = do_background_mining;
req.ignore_battery = ignore_battery;