Add mutex lock to RPC bootstrap_status (#2383)

This commit is contained in:
Sergey Kroshnin 2019-11-04 19:07:53 +03:00 committed by GitHub
commit a7903ba4cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1669,6 +1669,8 @@ void nano::json_handler::bootstrap_status ()
auto attempt (node.bootstrap_initiator.current_attempt ());
if (attempt != nullptr)
{
nano::lock_guard<std::mutex> lock (attempt->mutex);
nano::lock_guard<std::mutex> lazy_lock (attempt->lazy_mutex);
response_l.put ("clients", std::to_string (attempt->clients.size ()));
response_l.put ("pulls", std::to_string (attempt->pulls.size ()));
response_l.put ("pulling", std::to_string (attempt->pulling));