mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-25 00:25:36 +02:00
fix #846. ability to limit transit bandwidth
This commit is contained in:
parent
ac918e3618
commit
124e2e759c
7 changed files with 26 additions and 4 deletions
libi2pd
|
@ -261,6 +261,12 @@ namespace transport
|
|||
return bw > limit;
|
||||
}
|
||||
|
||||
bool Transports::IsTransitBandwidthExceeded () const
|
||||
{
|
||||
auto limit = i2p::context.GetTransitBandwidthLimit() * 1024; // convert to bytes
|
||||
return m_TransitBandwidth > limit;
|
||||
}
|
||||
|
||||
void Transports::SendMessage (const i2p::data::IdentHash& ident, std::shared_ptr<i2p::I2NPMessage> msg)
|
||||
{
|
||||
SendMessages (ident, std::vector<std::shared_ptr<i2p::I2NPMessage> > {msg });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue