Namespace indentation (#4817)
This commit is contained in:
parent
e65e07aa24
commit
e6a4c07bc9
2 changed files with 207 additions and 212 deletions
|
|
@ -17,14 +17,12 @@
|
||||||
|
|
||||||
namespace mi = boost::multi_index;
|
namespace mi = boost::multi_index;
|
||||||
|
|
||||||
namespace nano
|
namespace nano::bootstrap
|
||||||
{
|
{
|
||||||
namespace bootstrap
|
/** This class tracks accounts various account sets which are shared among the multiple bootstrap threads */
|
||||||
|
class account_sets
|
||||||
{
|
{
|
||||||
/** This class tracks accounts various account sets which are shared among the multiple bootstrap threads */
|
public: // Constants
|
||||||
class account_sets
|
|
||||||
{
|
|
||||||
public: // Constants
|
|
||||||
static double constexpr priority_initial = 2.0;
|
static double constexpr priority_initial = 2.0;
|
||||||
static double constexpr priority_increase = 2.0;
|
static double constexpr priority_increase = 2.0;
|
||||||
static double constexpr priority_divide = 2.0;
|
static double constexpr priority_divide = 2.0;
|
||||||
|
|
@ -32,7 +30,7 @@ namespace bootstrap
|
||||||
static double constexpr priority_cutoff = 0.15;
|
static double constexpr priority_cutoff = 0.15;
|
||||||
static unsigned constexpr max_fails = 3;
|
static unsigned constexpr max_fails = 3;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
account_sets (account_sets_config const &, nano::stats &);
|
account_sets (account_sets_config const &, nano::stats &);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,6 +56,7 @@ namespace bootstrap
|
||||||
* Sets information about the account chain that contains the block hash
|
* Sets information about the account chain that contains the block hash
|
||||||
*/
|
*/
|
||||||
void dependency_update (nano::block_hash const & hash, nano::account const & dependency_account);
|
void dependency_update (nano::block_hash const & hash, nano::account const & dependency_account);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should be called periodically to reinsert missing dependencies into the priority set
|
* Should be called periodically to reinsert missing dependencies into the priority set
|
||||||
*/
|
*/
|
||||||
|
|
@ -89,14 +88,14 @@ namespace bootstrap
|
||||||
|
|
||||||
nano::container_info container_info () const;
|
nano::container_info container_info () const;
|
||||||
|
|
||||||
private: // Dependencies
|
private: // Dependencies
|
||||||
account_sets_config const & config;
|
account_sets_config const & config;
|
||||||
nano::stats & stats;
|
nano::stats & stats;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void trim_overflow ();
|
void trim_overflow ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct priority_entry
|
struct priority_entry
|
||||||
{
|
{
|
||||||
nano::account account;
|
nano::account account;
|
||||||
|
|
@ -153,9 +152,8 @@ namespace bootstrap
|
||||||
ordered_priorities priorities;
|
ordered_priorities priorities;
|
||||||
ordered_blocking blocking;
|
ordered_blocking blocking;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using info_t = std::tuple<decltype (blocking), decltype (priorities)>; // <blocking, priorities>
|
using info_t = std::tuple<decltype (blocking), decltype (priorities)>; // <blocking, priorities>
|
||||||
info_t info () const;
|
info_t info () const;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,17 +13,15 @@
|
||||||
|
|
||||||
namespace mi = boost::multi_index;
|
namespace mi = boost::multi_index;
|
||||||
|
|
||||||
namespace nano
|
namespace nano::bootstrap
|
||||||
{
|
{
|
||||||
namespace bootstrap
|
// Container for tracking and scoring peers with respect to bootstrapping
|
||||||
|
class peer_scoring
|
||||||
{
|
{
|
||||||
// Container for tracking and scoring peers with respect to bootstrapping
|
public:
|
||||||
class peer_scoring
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static nano::transport::traffic_type constexpr traffic_type = nano::transport::traffic_type::bootstrap_requests;
|
static nano::transport::traffic_type constexpr traffic_type = nano::transport::traffic_type::bootstrap_requests;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
peer_scoring (bootstrap_config const &, nano::network_constants const &);
|
peer_scoring (bootstrap_config const &, nano::network_constants const &);
|
||||||
|
|
||||||
// Returns true if channel limit has been exceeded
|
// Returns true if channel limit has been exceeded
|
||||||
|
|
@ -45,11 +43,11 @@ namespace bootstrap
|
||||||
|
|
||||||
nano::container_info container_info () const;
|
nano::container_info container_info () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bootstrap_config const & config;
|
bootstrap_config const & config;
|
||||||
nano::network_constants const & network_constants;
|
nano::network_constants const & network_constants;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class peer_score
|
class peer_score
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -94,6 +92,5 @@ namespace bootstrap
|
||||||
ordered_scoring scoring;
|
ordered_scoring scoring;
|
||||||
|
|
||||||
std::deque<std::shared_ptr<nano::transport::channel>> channels;
|
std::deque<std::shared_ptr<nano::transport::channel>> channels;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue