rpc: do not propagate exceptions out of a dtor

Coverity 205415
This commit is contained in:
moneromooo-monero 2019-10-26 08:12:49 +00:00
parent 3c849188ab
commit d56a483abe
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -86,10 +86,14 @@ namespace
RPCTracker(const char *rpc, tools::LoggingPerformanceTimer &timer): rpc(rpc), timer(timer) { RPCTracker(const char *rpc, tools::LoggingPerformanceTimer &timer): rpc(rpc), timer(timer) {
} }
~RPCTracker() { ~RPCTracker() {
boost::unique_lock<boost::mutex> lock(mutex); try
auto &e = tracker[rpc]; {
++e.count; boost::unique_lock<boost::mutex> lock(mutex);
e.time += timer.value(); auto &e = tracker[rpc];
++e.count;
e.time += timer.value();
}
catch (...) { /* ignore */ }
} }
void pay(uint64_t amount) { void pay(uint64_t amount) {
boost::unique_lock<boost::mutex> lock(mutex); boost::unique_lock<boost::mutex> lock(mutex);