Browse Source

add zero check to congestion level calculations

pull/2024/head
Vort 9 months ago
parent
commit
5415598f60
  1. 2
      libi2pd/Tunnel.h

2
libi2pd/Tunnel.h

@ -240,7 +240,7 @@ namespace tunnel @@ -240,7 +240,7 @@ namespace tunnel
void SetMaxNumTransitTunnels (uint32_t 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:

Loading…
Cancel
Save