aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rpc/core_rpc_server.cpp16
-rw-r--r--src/rpc/rpc_payment.cpp4
-rw-r--r--src/wallet/node_rpc_proxy.cpp4
3 files changed, 18 insertions, 6 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 6f7a401c7..e92ae7c08 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -87,10 +87,14 @@ namespace
RPCTracker(const char *rpc, tools::LoggingPerformanceTimer &timer): rpc(rpc), timer(timer) {
}
~RPCTracker() {
- boost::unique_lock<boost::mutex> lock(mutex);
- auto &e = tracker[rpc];
- ++e.count;
- e.time += timer.value();
+ try
+ {
+ boost::unique_lock<boost::mutex> lock(mutex);
+ auto &e = tracker[rpc];
+ ++e.count;
+ e.time += timer.value();
+ }
+ catch (...) { /* ignore */ }
}
void pay(uint64_t amount) {
boost::unique_lock<boost::mutex> lock(mutex);
@@ -2229,8 +2233,7 @@ namespace cryptonote
//------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_get_info_json(const COMMAND_RPC_GET_INFO::request& req, COMMAND_RPC_GET_INFO::response& res, epee::json_rpc::error& error_resp, const connection_context *ctx)
{
- on_get_info(req, res, ctx);
- if (res.status != CORE_RPC_STATUS_OK)
+ if (!on_get_info(req, res, ctx) || res.status != CORE_RPC_STATUS_OK)
{
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;
error_resp.message = res.status;
@@ -2624,6 +2627,7 @@ namespace cryptonote
{
RPC_TRACKER(update);
+ res.update = false;
if (m_core.offline())
{
res.status = "Daemon is running offline";
diff --git a/src/rpc/rpc_payment.cpp b/src/rpc/rpc_payment.cpp
index 0637db728..b363c27b2 100644
--- a/src/rpc/rpc_payment.cpp
+++ b/src/rpc/rpc_payment.cpp
@@ -59,6 +59,10 @@
namespace cryptonote
{
rpc_payment::client_info::client_info():
+ previous_seed_height(0),
+ seed_height(0),
+ previous_seed_hash(crypto::null_hash),
+ seed_hash(crypto::null_hash),
cookie(0),
top(crypto::null_hash),
previous_top(crypto::null_hash),
diff --git a/src/wallet/node_rpc_proxy.cpp b/src/wallet/node_rpc_proxy.cpp
index 005b0bafa..f3698b599 100644
--- a/src/wallet/node_rpc_proxy.cpp
+++ b/src/wallet/node_rpc_proxy.cpp
@@ -78,6 +78,10 @@ void NodeRPCProxy::invalidate()
m_rpc_payment_seed_hash = crypto::null_hash;
m_rpc_payment_next_seed_hash = crypto::null_hash;
m_height_time = 0;
+ m_rpc_payment_diff = 0;
+ m_rpc_payment_credits_per_hash_found = 0;
+ m_rpc_payment_height = 0;
+ m_rpc_payment_cookie = 0;
}
boost::optional<std::string> NodeRPCProxy::get_rpc_version(uint32_t &rpc_version)