Removing unused variables. (#2960)

Spawning only one invocation on a strand, which is a temporary, is redundant. Syntax isn't accepted by Boost 1.74
This commit is contained in:
clemahieu 2020-09-21 10:19:42 +02:00 committed by GitHub
commit 70b4b7db3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 13 deletions

View file

@ -163,7 +163,7 @@ boost::property_tree::ptree rpc_request (boost::property_tree::ptree const & req
debug_assert (results.size () == 1); debug_assert (results.size () == 1);
std::promise<boost::optional<boost::property_tree::ptree>> promise; std::promise<boost::optional<boost::property_tree::ptree>> promise;
boost::asio::spawn (boost::asio::io_context::strand (ioc), [&ioc, &results, request, &promise](boost::asio::yield_context yield) { boost::asio::spawn (ioc, [&ioc, &results, request, &promise](boost::asio::yield_context yield) {
socket_type socket (ioc); socket_type socket (ioc);
boost::beast::flat_buffer buffer; boost::beast::flat_buffer buffer;
http::request<http::string_body> req; http::request<http::string_body> req;
@ -457,7 +457,7 @@ int main (int argc, char * const * argv)
} }
// Send from genesis account to different accounts and receive the funds // Send from genesis account to different accounts and receive the funds
boost::asio::spawn (boost::asio::io_context::strand (ioc), [&ioc, &primary_node_results, &wallet, &resolver, &node_count, destination_account, &send_calls_remaining](boost::asio::yield_context yield) { boost::asio::spawn (ioc, [&ioc, &primary_node_results, &wallet, destination_account, &send_calls_remaining](boost::asio::yield_context yield) {
send_receive (ioc, wallet, nano::genesis_account.to_account (), destination_account->as_string, send_calls_remaining, primary_node_results, yield); send_receive (ioc, wallet, nano::genesis_account.to_account (), destination_account->as_string, send_calls_remaining, primary_node_results, yield);
}); });
} }

View file

@ -1008,7 +1008,6 @@ int main (int argc, char * const * argv)
} }
} }
uint64_t block_count (0);
node->block_processor.flush (); node->block_processor.flush ();
auto end (std::chrono::high_resolution_clock::now ()); auto end (std::chrono::high_resolution_clock::now ());
auto time (std::chrono::duration_cast<std::chrono::microseconds> (end - begin).count ()); auto time (std::chrono::duration_cast<std::chrono::microseconds> (end - begin).count ());

View file

@ -83,7 +83,6 @@ bool nano::active_transactions::insert_election_from_frontiers_confirmation (std
nano::frontiers_confirmation_info nano::active_transactions::get_frontiers_confirmation_info () nano::frontiers_confirmation_info nano::active_transactions::get_frontiers_confirmation_info ()
{ {
// Limit maximum count of elections to start // Limit maximum count of elections to start
nano::frontiers_confirmation_info frontiers_confirmation_info;
auto rep_counts (node.wallets.reps ()); auto rep_counts (node.wallets.reps ());
bool representative (node.config.enable_voting && rep_counts.voting > 0); bool representative (node.config.enable_voting && rep_counts.voting > 0);
bool half_princpal_representative (representative && rep_counts.half_principal > 0); bool half_princpal_representative (representative && rep_counts.half_principal > 0);

View file

@ -64,10 +64,10 @@ void rocksdb_val::convert_buffer_to_value ()
} }
nano::rocksdb_store::rocksdb_store (nano::logger_mt & logger_a, boost::filesystem::path const & path_a, nano::rocksdb_config const & rocksdb_config_a, bool open_read_only_a) : nano::rocksdb_store::rocksdb_store (nano::logger_mt & logger_a, boost::filesystem::path const & path_a, nano::rocksdb_config const & rocksdb_config_a, bool open_read_only_a) :
logger (logger_a), logger{ logger_a },
rocksdb_config (rocksdb_config_a), rocksdb_config{ rocksdb_config_a },
cf_name_table_map (create_cf_name_table_map ()), max_block_write_batch_num_m{ nano::narrow_cast<unsigned> (blocks_memtable_size_bytes () / (2 * (sizeof (nano::block_type) + nano::state_block::size + nano::block_sideband::size (nano::block_type::state)))) },
max_block_write_batch_num_m (nano::narrow_cast<unsigned> (blocks_memtable_size_bytes () / (2 * (sizeof (nano::block_type) + nano::state_block::size + nano::block_sideband::size (nano::block_type::state))))) cf_name_table_map{ create_cf_name_table_map () }
{ {
boost::system::error_code error_mkdir, error_chmod; boost::system::error_code error_mkdir, error_chmod;
boost::filesystem::create_directories (path_a, error_mkdir); boost::filesystem::create_directories (path_a, error_mkdir);
@ -160,8 +160,6 @@ rocksdb::ColumnFamilyOptions nano::rocksdb_store::get_common_cf_options (std::sh
rocksdb::ColumnFamilyOptions cf_options; rocksdb::ColumnFamilyOptions cf_options;
cf_options.table_factory = table_factory_a; cf_options.table_factory = table_factory_a;
auto write_buffer_size = memtable_size_bytes_a;
// (1 active, 1 inactive) // (1 active, 1 inactive)
auto num_memtables = 2; auto num_memtables = 2;

View file

@ -36,7 +36,6 @@ public:
rocksdb_iterator (rocksdb::DB * db, nano::transaction const & transaction_a, rocksdb::ColumnFamilyHandle * handle_a, rocksdb_val const * val_a) rocksdb_iterator (rocksdb::DB * db, nano::transaction const & transaction_a, rocksdb::ColumnFamilyHandle * handle_a, rocksdb_val const * val_a)
{ {
// Don't fill the block cache for any blocks read as a result of an iterator // Don't fill the block cache for any blocks read as a result of an iterator
rocksdb::Iterator * iter;
if (is_read (transaction_a)) if (is_read (transaction_a))
{ {
auto & read_options = snapshot_options (transaction_a); auto & read_options = snapshot_options (transaction_a);

View file

@ -171,7 +171,7 @@ size_t nano::vote_generator::generate (std::vector<std::shared_ptr<nano::block>>
request_t::first_type candidates; request_t::first_type candidates;
{ {
auto transaction (ledger.store.tx_begin_read ()); auto transaction (ledger.store.tx_begin_read ());
auto dependents_confirmed = [&blocks_a, &transaction, this](auto const & block_a) { auto dependents_confirmed = [&transaction, this](auto const & block_a) {
return this->ledger.dependents_confirmed (transaction, *block_a); return this->ledger.dependents_confirmed (transaction, *block_a);
}; };
auto as_candidate = [](auto const & block_a) { auto as_candidate = [](auto const & block_a) {
@ -282,7 +282,7 @@ void nano::vote_generator::vote (std::vector<nano::block_hash> const & hashes_a,
std::vector<std::shared_ptr<nano::vote>> votes_l; std::vector<std::shared_ptr<nano::vote>> votes_l;
{ {
auto transaction (ledger.store.tx_begin_read ()); auto transaction (ledger.store.tx_begin_read ());
wallets.foreach_representative ([this, &hashes_a, &roots_a, &transaction, &votes_l](nano::public_key const & pub_a, nano::raw_key const & prv_a) { wallets.foreach_representative ([this, &hashes_a, &transaction, &votes_l](nano::public_key const & pub_a, nano::raw_key const & prv_a) {
votes_l.emplace_back (this->ledger.store.vote_generate (transaction, pub_a, prv_a, hashes_a)); votes_l.emplace_back (this->ledger.store.vote_generate (transaction, pub_a, prv_a, hashes_a));
}); });
} }