mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
count tunnel acceptance ratio for peer selection
This commit is contained in:
parent
d0ac6345c2
commit
de5c55160b
2 changed files with 36 additions and 7 deletions
|
@ -24,18 +24,24 @@ namespace data
|
|||
public:
|
||||
|
||||
RouterProfile (const IdentHash& identHash);
|
||||
RouterProfile& operator= (const RouterProfile& ) = default;
|
||||
|
||||
void Save ();
|
||||
void Load ();
|
||||
|
||||
bool IsBad () const { return !m_NumTunnelsAgreed && m_NumTunnelsDeclined >= 5; };
|
||||
bool IsBad () const;
|
||||
|
||||
void TunnelBuildResponse (uint8_t ret);
|
||||
void TunnelNonReplied ();
|
||||
|
||||
private:
|
||||
|
||||
boost::posix_time::ptime GetTime () const;
|
||||
void UpdateTime ();
|
||||
|
||||
bool IsAlwaysDeclining () const { return !m_NumTunnelsAgreed && m_NumTunnelsDeclined >= 5; };
|
||||
bool IsNonResponding () const { return m_NumTunnelsNonReplied > 20 && !(m_NumTunnelsAgreed + m_NumTunnelsDeclined); };
|
||||
bool IsLowPartcipationRate () const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue