Browse Source

Merge pull request #2024 from Vort/congestion_zero_check

add zero check to congestion level calculations
pull/2017/head
orignal 9 months ago committed by GitHub
parent
commit
ee8449fa05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      libi2pd/Tunnel.h

2
libi2pd/Tunnel.h

@ -240,7 +240,7 @@ namespace tunnel
void SetMaxNumTransitTunnels (uint32_t maxNumTransitTunnels); void SetMaxNumTransitTunnels (uint32_t maxNumTransitTunnels);
uint32_t GetMaxNumTransitTunnels () const { return m_MaxNumTransitTunnels; }; uint32_t GetMaxNumTransitTunnels () const { return m_MaxNumTransitTunnels; };
int GetCongestionLevel() const { return CONGESTION_LEVEL_FULL * m_TransitTunnels.size() / m_MaxNumTransitTunnels; } int GetCongestionLevel() const { return m_MaxNumTransitTunnels ? CONGESTION_LEVEL_FULL * m_TransitTunnels.size() / m_MaxNumTransitTunnels : CONGESTION_LEVEL_FULL; }
private: private:

Loading…
Cancel
Save