Merge pull request #5526

1e8f3f6 rpc: fail update RPC when running offline (moneromooo-monero)
This commit is contained in:
luigi1111 2019-05-14 15:54:10 -05:00
commit 5a67ff2b32
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -2107,6 +2107,13 @@ namespace cryptonote
bool core_rpc_server::on_update(const COMMAND_RPC_UPDATE::request& req, COMMAND_RPC_UPDATE::response& res, const connection_context *ctx) bool core_rpc_server::on_update(const COMMAND_RPC_UPDATE::request& req, COMMAND_RPC_UPDATE::response& res, const connection_context *ctx)
{ {
PERF_TIMER(on_update); PERF_TIMER(on_update);
if (m_core.offline())
{
res.status = "Daemon is running offline";
return true;
}
static const char software[] = "monero"; static const char software[] = "monero";
#ifdef BUILD_TAG #ifdef BUILD_TAG
static const char buildtag[] = BOOST_PP_STRINGIZE(BUILD_TAG); static const char buildtag[] = BOOST_PP_STRINGIZE(BUILD_TAG);