aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-10-28 18:08:14 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-10-28 18:09:36 +0000
commit051ddbc741b1b703f5d58193ea770b13887d4e49 (patch)
tree0592af68b26102813ca855fe0a0cb38457b2df48 /src/rpc
parentMerge pull request #453 (diff)
downloadmonero-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 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp1
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 6cfcec08c..f2a464c20 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -127,6 +127,7 @@ namespace cryptonote
res.incoming_connections_count = total_conn - res.outgoing_connections_count;
res.white_peerlist_size = m_p2p.get_peerlist_manager().get_white_peers_count();
res.grey_peerlist_size = m_p2p.get_peerlist_manager().get_gray_peers_count();
+ res.testnet = m_testnet;
res.status = CORE_RPC_STATUS_OK;
return true;
}
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index cb8845e8c..aa88ffcb4 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -280,6 +280,7 @@ namespace cryptonote
uint64_t incoming_connections_count;
uint64_t white_peerlist_size;
uint64_t grey_peerlist_size;
+ bool testnet;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
@@ -293,6 +294,7 @@ namespace cryptonote
KV_SERIALIZE(incoming_connections_count)
KV_SERIALIZE(white_peerlist_size)
KV_SERIALIZE(grey_peerlist_size)
+ KV_SERIALIZE(testnet)
END_KV_SERIALIZE_MAP()
};
};