aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-05-02 11:30:11 +0200
committerRiccardo Spagni <ric@spagni.net>2019-05-02 11:30:11 +0200
commit52eb454d7b9f5aba42eb693c5acd4bfbf4853643 (patch)
tree356b200d36e5063a98b2f88124b40b9c5cacac84
parentMerge pull request #5489 (diff)
parentwallet_rpc_server: adding missing return on error in set_daemon (diff)
downloadmonero-52eb454d7b9f5aba42eb693c5acd4bfbf4853643.tar.xz
Merge pull request #5491
98fb98f9 wallet_rpc_server: adding missing return on error in set_daemon (moneromooo-monero) 9074c0d8 wallet_rpc_server: return false on error in set_log_categories (moneromooo-monero) 968848a7 wallet_rpc_server: fix crash in validate_address if no wallet is loaded (moneromooo-monero)
-rw-r--r--src/wallet/wallet_rpc_server.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 4076ae957..8e67f8f51 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -4069,9 +4069,10 @@ namespace tools
{ cryptonote::TESTNET, "testnet" },
{ cryptonote::STAGENET, "stagenet" },
};
+ if (!req.any_net_type && !m_wallet) return not_open(er);
for (const auto &net_type: net_types)
{
- if (!req.any_net_type && net_type.type != m_wallet->nettype())
+ if (!req.any_net_type && (!m_wallet || net_type.type != m_wallet->nettype()))
continue;
if (req.allow_openalias)
{
@@ -4153,6 +4154,7 @@ namespace tools
{
er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION;
er.message = "SSL is enabled but no user certificate or fingerprints were provided";
+ return false;
}
if (!m_wallet->set_daemon(req.address, boost::none, req.trusted, std::move(ssl_options)))
@@ -4177,7 +4179,7 @@ namespace tools
{
er.code = WALLET_RPC_ERROR_CODE_INVALID_LOG_LEVEL;
er.message = "Error: log level not valid";
- return true;
+ return false;
}
mlog_set_log_level(req.level);
return true;