diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-28 18:08:14 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-28 18:09:36 +0000 |
commit | 051ddbc741b1b703f5d58193ea770b13887d4e49 (patch) | |
tree | 0592af68b26102813ca855fe0a0cb38457b2df48 /src/daemon/command_parser_executor.cpp | |
parent | Merge pull request #453 (diff) | |
download | monero-051ddbc741b1b703f5d58193ea770b13887d4e49.tar.xz |
rpc: fix start_mining and status RPC crashes
They check whether they're running on testnet by accessing the
m_rpc_server object, which does not exist when in RPC mode.
Also, fix hard_fork_info being called with the wrong API.
Diffstat (limited to '')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 51e3231e5..a07bb25de 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -230,6 +230,7 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg } cryptonote::account_public_address adr; + bool testnet = false; if(!cryptonote::get_account_address_from_str(adr, false, args.front())) { if(!cryptonote::get_account_address_from_str(adr, true, args.front())) @@ -237,6 +238,7 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg std::cout << "target account address has wrong format" << std::endl; return true; } + testnet = true; std::cout << "Mining to a testnet address, make sure this is intentional!" << std::endl; } uint64_t threads_count = 1; @@ -250,7 +252,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); + m_executor.start_mining(adr, threads_count, testnet); return true; } |