mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
check crypto type and congestion of connected peer for tunnel
This commit is contained in:
parent
28adb54c0a
commit
32ab95478e
2 changed files with 7 additions and 5 deletions
|
@ -72,17 +72,18 @@ namespace transport
|
|||
uint64_t creationTime, nextRouterInfoUpdateTime;
|
||||
std::vector<std::shared_ptr<i2p::I2NPMessage> > delayedMessages;
|
||||
std::vector<i2p::data::RouterInfo::SupportedTransports> priority;
|
||||
bool isHighBandwidth, isReachable;
|
||||
bool isHighBandwidth, isEligible;
|
||||
|
||||
Peer (std::shared_ptr<const i2p::data::RouterInfo> r, uint64_t ts):
|
||||
numAttempts (0), router (r), creationTime (ts),
|
||||
nextRouterInfoUpdateTime (ts + PEER_ROUTER_INFO_UPDATE_INTERVAL),
|
||||
isHighBandwidth (false), isReachable (false)
|
||||
isHighBandwidth (false), isEligible (false)
|
||||
{
|
||||
if (router)
|
||||
{
|
||||
isHighBandwidth = router->IsHighBandwidth ();
|
||||
isReachable = (bool)router->GetCompatibleTransports (true);
|
||||
isEligible = router->IsECIES () && (bool)router->GetCompatibleTransports (true) && // reachable
|
||||
router->GetCongestion () != i2p::data::RouterInfo::eRejectAll;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +102,8 @@ namespace transport
|
|||
if (router)
|
||||
{
|
||||
isHighBandwidth = router->IsHighBandwidth ();
|
||||
isReachable = (bool)router->GetCompatibleTransports (true);
|
||||
isEligible = router->IsECIES () && (bool)router->GetCompatibleTransports (true) && // reachable
|
||||
router->GetCongestion () != i2p::data::RouterInfo::eRejectAll;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue