aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-26 08:12:49 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-11-27 19:52:36 +0000
commitd56a483abea2e7803ef47cbcb48a86a45e605410 (patch)
treedb32811b6709883c1f93eb49315b4d422861bbdb /src/rpc/core_rpc_server.cpp
parentrpc: always set the update field in update on sucess (diff)
downloadmonero-d56a483abea2e7803ef47cbcb48a86a45e605410.tar.xz
rpc: do not propagate exceptions out of a dtor
Coverity 205415
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index dbacd489d..858b35df2 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -86,10 +86,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);