diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-09 19:14:17 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-09 19:14:49 +0000 |
commit | 1e8f3f66bf3bbe48ac14a9bb06a10de44fef0586 (patch) | |
tree | 6289ea3c45141ce3d26b973abe401c2596b66b1b /src | |
parent | Merge pull request #5509 (diff) | |
download | monero-1e8f3f66bf3bbe48ac14a9bb06a10de44fef0586.tar.xz |
rpc: fail update RPC when running offline
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 7 |
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); |