update RouterInfo if congestion cap changed

pull/1904/head
orignal 1 year ago
parent 6d7f20961f
commit 46e4f4aea5

@ -1397,7 +1397,8 @@ namespace i2p
{
if (ecode != boost::asio::error::operation_aborted)
{
m_RouterInfo.SetHighCongestion (IsHighCongestion ());
if (m_RouterInfo.SetHighCongestion (IsHighCongestion ()))
UpdateRouterInfo ();
ScheduleCongestionUpdate ();
}
}

@ -1149,14 +1149,16 @@ namespace data
SetProperty ("caps", caps);
}
void LocalRouterInfo::SetHighCongestion (bool highCongestion)
bool LocalRouterInfo::SetHighCongestion (bool highCongestion)
{
Congestion c = highCongestion ? eHighCongestion : eLowCongestion;
if (c != GetCongestion ())
{
SetCongestion (c);
UpdateCapsProperty ();
return true;
}
return false;
}
void LocalRouterInfo::WriteToStream (std::ostream& s) const

@ -332,7 +332,7 @@ namespace data
LocalRouterInfo (const std::string& fullPath);
void CreateBuffer (const PrivateKeys& privateKeys);
void UpdateCaps (uint8_t caps);
void SetHighCongestion (bool highCongestion);
bool SetHighCongestion (bool highCongestion); // returns true if updated
void SetProperty (const std::string& key, const std::string& value) override;
void DeleteProperty (const std::string& key);

Loading…
Cancel
Save