From b600e3a75941ca06d0c8ddce47493f366146f851 Mon Sep 17 00:00:00 2001 From: gr0vity-dev Date: Mon, 6 May 2024 13:38:06 +0200 Subject: [PATCH] formatting --- nano/node/active_transactions.cpp | 1 - nano/node/active_transactions.hpp | 25 +++++++++++-------------- nano/node/nodeconfig.cpp | 4 ++-- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index dbff6b5b1..9674e38ab 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -766,7 +766,6 @@ std::unique_ptr nano::recently_cemented_cache::c return composite; } - /* * active_transactions_config */ diff --git a/nano/node/active_transactions.hpp b/nano/node/active_transactions.hpp index 2183da163..6b8f1f326 100644 --- a/nano/node/active_transactions.hpp +++ b/nano/node/active_transactions.hpp @@ -44,26 +44,23 @@ namespace nano class active_transactions_config final { public: - explicit active_transactions_config (nano::network_constants const &); + explicit active_transactions_config (nano::network_constants const &); - nano::error deserialize (nano::tomlconfig & toml); - nano::error serialize (nano::tomlconfig & toml) const; + nano::error deserialize (nano::tomlconfig & toml); + nano::error serialize (nano::tomlconfig & toml) const; public: - // Maximum number of simultaneous active elections (AEC size) - std::size_t size{ 5000 }; - // Limit of hinted elections as percentage of `active_elections_size` - std::size_t hinted_limit_percentage{ 20 }; - // Limit of optimistic elections as percentage of `active_elections_size` - std::size_t optimistic_limit_percentage{ 10 }; + // Maximum number of simultaneous active elections (AEC size) + std::size_t size{ 5000 }; + // Limit of hinted elections as percentage of `active_elections_size` + std::size_t hinted_limit_percentage{ 20 }; + // Limit of optimistic elections as percentage of `active_elections_size` + std::size_t optimistic_limit_percentage{ 10 }; // Maximum confirmation history size std::size_t confirmation_history_size{ 2048 }; // Maximum cache size for recently_confirmed std::size_t confirmation_cache{ 65536 }; - - - -}; +}; class recently_confirmed_cache final { @@ -234,7 +231,7 @@ private: private: // Dependencies active_transactions_config const & config; - nano::node & node; + nano::node & node; nano::confirming_set & confirming_set; nano::block_processor & block_processor; diff --git a/nano/node/nodeconfig.cpp b/nano/node/nodeconfig.cpp index ee5d2c531..577db2a49 100644 --- a/nano/node/nodeconfig.cpp +++ b/nano/node/nodeconfig.cpp @@ -120,7 +120,7 @@ nano::error nano::node_config::serialize_toml (nano::tomlconfig & toml) const toml.put ("external_port", external_port, "The external port number of this node (NAT). Only used if external_address is set.\ntype:uint16"); toml.put ("tcp_incoming_connections_max", tcp_incoming_connections_max, "Maximum number of incoming TCP connections.\ntype:uint64"); toml.put ("use_memory_pools", use_memory_pools, "If true, allocate memory from memory pools. Enabling this may improve performance. Memory is never released to the OS.\ntype:bool"); - + toml.put ("bandwidth_limit", bandwidth_limit, "Outbound traffic limit in bytes/sec after which messages will be dropped.\nNote: changing to unlimited bandwidth (0) is not recommended for limited connections.\ntype:uint64"); toml.put ("bandwidth_limit_burst_ratio", bandwidth_limit_burst_ratio, "Burst ratio for outbound traffic shaping.\ntype:double"); @@ -468,7 +468,7 @@ nano::error nano::node_config::deserialize_toml (nano::tomlconfig & toml) toml.get (pow_sleep_interval_key, pow_sleep_interval_l); pow_sleep_interval = std::chrono::nanoseconds (pow_sleep_interval_l); toml.get ("use_memory_pools", use_memory_pools); - + toml.get ("bandwidth_limit", bandwidth_limit); toml.get ("bandwidth_limit_burst_ratio", bandwidth_limit_burst_ratio);