diff options
Diffstat (limited to 'src/rpc/core_rpc_server_commands_defs.h')
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 13 |
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 c634b8957..def1f3804 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 |