fix #846. ability to limit transit bandwidth

This commit is contained in:
orignal 2017-05-04 14:58:12 -04:00
parent ac918e3618
commit 124e2e759c
7 changed files with 26 additions and 4 deletions

View file

@ -332,7 +332,8 @@ namespace i2p
// replace record to reply
if (i2p::context.AcceptsTunnels () &&
i2p::tunnel::tunnels.GetTransitTunnels ().size () <= g_MaxNumTransitTunnels &&
!i2p::transport::transports.IsBandwidthExceeded ())
!i2p::transport::transports.IsBandwidthExceeded () &&
!i2p::transport::transports.IsTransitBandwidthExceeded ())
{
auto transitTunnel = i2p::tunnel::CreateTransitTunnel (
bufbe32toh (clearText + BUILD_REQUEST_RECORD_RECEIVE_TUNNEL_OFFSET),