aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-09 19:14:17 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-09 19:14:49 +0000
commit1e8f3f66bf3bbe48ac14a9bb06a10de44fef0586 (patch)
tree6289ea3c45141ce3d26b973abe401c2596b66b1b
parentMerge pull request #5509 (diff)
downloadmonero-1e8f3f66bf3bbe48ac14a9bb06a10de44fef0586.tar.xz
rpc: fail update RPC when running offline
-rw-r--r--src/rpc/core_rpc_server.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index bbcbc2fcd..5777370fc 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -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)
{
PERF_TIMER(on_update);
+
+ if (m_core.offline())
+ {
+ res.status = "Daemon is running offline";
+ return true;
+ }
+
static const char software[] = "monero";
#ifdef BUILD_TAG
static const char buildtag[] = BOOST_PP_STRINGIZE(BUILD_TAG);