aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2024-07-16 18:58:08 -0400
committerluigi1111 <luigi1111w@gmail.com>2024-07-16 18:58:08 -0400
commit8dbbc478047b4b036cdd722d67f90313550bb8d7 (patch)
treec5bf2046da95fa723844e298271cba80ddcc84c9 /src/rpc
parentMerge pull request #9370 (diff)
parentwallet2: move get_rpc_status func to RPC server definition file (diff)
downloadmonero-8dbbc478047b4b036cdd722d67f90313550bb8d7.tar.xz
Merge pull request #9379
6c28bdb wallet2: move get_rpc_status func to RPC server definition file (j-berman)
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 1c33a5446..80c9cc766 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -80,6 +80,19 @@ namespace cryptonote
#define CORE_RPC_STATUS_NOT_MINING "NOT MINING"
#define CORE_RPC_STATUS_PAYMENT_REQUIRED "PAYMENT REQUIRED"
+inline const std::string get_rpc_status(const bool trusted_daemon, const std::string &s)
+{
+ if (trusted_daemon)
+ return s;
+ if (s == CORE_RPC_STATUS_OK)
+ return s;
+ if (s == CORE_RPC_STATUS_BUSY)
+ return s;
+ if (s == CORE_RPC_STATUS_PAYMENT_REQUIRED)
+ return s;
+ return "<error>";
+}
+
// When making *any* change here, bump minor
// If the change is incompatible, then bump major and set minor to 0
// This ensures CORE_RPC_VERSION always increases, that every change