don't accept tunnels if bandwidth is exceeded

This commit is contained in:
orignal 2015-03-18 13:07:11 -04:00
parent b693d13144
commit 47c3d5ed23
5 changed files with 11 additions and 2 deletions

View file

@ -199,6 +199,11 @@ namespace transport
m_LastOutBandwidthUpdateBytes = m_TotalSentBytes;
}
bool Transports::IsBandwidthExceeded () const
{
if (i2p::context.GetRouterInfo ().IsHighBandwidth ()) return false;
return std::max (m_InBandwidth, m_OutBandwidth) > LOW_BANDWIDTH_LIMIT;
}
void Transports::SendMessage (const i2p::data::IdentHash& ident, i2p::I2NPMessage * msg)
{