diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-05-14 15:54:10 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-05-14 15:54:10 -0500 |
commit | 5a67ff2b322616269d699eb47730a8ff604ea71d (patch) | |
tree | d80af1bfe1f02ae0960b95fc771c462a0f848976 | |
parent | Merge pull request #5519 (diff) | |
parent | rpc: fail update RPC when running offline (diff) | |
download | monero-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.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); |