mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
send exporatory message directly if connected to a floodfill
This commit is contained in:
parent
1e2f038ef5
commit
60351f2677
|
@ -828,6 +828,8 @@ namespace data
|
||||||
if (floodfill && !floodfills.count (floodfill.get ())) // request floodfill only once
|
if (floodfill && !floodfills.count (floodfill.get ())) // request floodfill only once
|
||||||
{
|
{
|
||||||
floodfills.insert (floodfill.get ());
|
floodfills.insert (floodfill.get ());
|
||||||
|
if (i2p::transport::transports.IsConnected (floodfill->GetIdentHash ()))
|
||||||
|
throughTunnels = false;
|
||||||
if (throughTunnels)
|
if (throughTunnels)
|
||||||
{
|
{
|
||||||
msgs.push_back (i2p::tunnel::TunnelMessageBlock
|
msgs.push_back (i2p::tunnel::TunnelMessageBlock
|
||||||
|
|
|
@ -474,6 +474,12 @@ namespace transport
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Transports::IsConnected (const i2p::data::IdentHash& ident) const
|
||||||
|
{
|
||||||
|
auto it = m_Peers.find (ident);
|
||||||
|
return it != m_Peers.end ();
|
||||||
|
}
|
||||||
|
|
||||||
void Transports::HandlePeerCleanupTimer (const boost::system::error_code& ecode)
|
void Transports::HandlePeerCleanupTimer (const boost::system::error_code& ecode)
|
||||||
{
|
{
|
||||||
if (ecode != boost::asio::error::operation_aborted)
|
if (ecode != boost::asio::error::operation_aborted)
|
||||||
|
|
|
@ -88,7 +88,8 @@ namespace transport
|
||||||
|
|
||||||
void PeerConnected (std::shared_ptr<TransportSession> session);
|
void PeerConnected (std::shared_ptr<TransportSession> session);
|
||||||
void PeerDisconnected (std::shared_ptr<TransportSession> session);
|
void PeerDisconnected (std::shared_ptr<TransportSession> session);
|
||||||
|
bool IsConnected (const i2p::data::IdentHash& ident) const;
|
||||||
|
|
||||||
void UpdateSentBytes (uint64_t numBytes) { m_TotalSentBytes += numBytes; };
|
void UpdateSentBytes (uint64_t numBytes) { m_TotalSentBytes += numBytes; };
|
||||||
void UpdateReceivedBytes (uint64_t numBytes) { m_TotalReceivedBytes += numBytes; };
|
void UpdateReceivedBytes (uint64_t numBytes) { m_TotalReceivedBytes += numBytes; };
|
||||||
uint64_t GetTotalSentBytes () const { return m_TotalSentBytes; };
|
uint64_t GetTotalSentBytes () const { return m_TotalSentBytes; };
|
||||||
|
|
Loading…
Reference in a new issue