Include requesting telemetry metrics from temporary channels (#2653)

* Include requesting telemetry metrics from temporary channels

* Read transaction no longer needed (Gui comment)
This commit is contained in:
Wesley Shillingford 2020-03-12 14:02:52 +00:00 committed by GitHub
commit 6aea75e12b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -51,7 +51,7 @@ private: // State management
static int constexpr confirmed_duration_factor = 5;
std::atomic<nano::election::state_t> state_m = { state_t::idle };
// Protects state_start, last_vote and last_block
// These time points must be protected by this mutex
std::mutex timepoints_mutex;
std::chrono::steady_clock::time_point state_start = { std::chrono::steady_clock::now () };
std::chrono::steady_clock::time_point last_block = { std::chrono::steady_clock::now () };

View file

@ -1226,8 +1226,7 @@ void nano::json_handler::block_account ()
void nano::json_handler::block_count ()
{
auto transaction (node.store.tx_begin_read ());
response_l.put ("count", std::to_string (node.store.block_count (transaction).sum ()));
response_l.put ("count", std::to_string (node.ledger.cache.block_count));
response_l.put ("unchecked", std::to_string (node.ledger.cache.unchecked_count));
response_l.put ("cemented", std::to_string (node.ledger.cache.cemented_count));
response_errors ();

View file

@ -111,7 +111,7 @@ void nano::telemetry::ongoing_req_all_peers (std::chrono::milliseconds next_requ
peers;
{
auto temp_peers = this_l->network.list (std::numeric_limits<size_t>::max (), this_l->network_params.protocol.telemetry_protocol_version_min, false);
auto temp_peers = this_l->network.list (std::numeric_limits<size_t>::max (), this_l->network_params.protocol.telemetry_protocol_version_min);
peers.insert (temp_peers.begin (), temp_peers.end ());
}