aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-05-14 15:54:10 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-05-14 15:54:10 -0500
commit5a67ff2b322616269d699eb47730a8ff604ea71d (patch)
treed80af1bfe1f02ae0960b95fc771c462a0f848976
parentMerge pull request #5519 (diff)
parentrpc: fail update RPC when running offline (diff)
downloadmonero-5a67ff2b322616269d699eb47730a8ff604ea71d.tar.xz
Merge pull request #5526
1e8f3f6 rpc: fail update RPC when running offline (moneromooo-monero)
-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);