mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-24 22:44:15 +00:00
update LeaseSet if inbound tunnel was restored
This commit is contained in:
parent
0213f058d1
commit
fe71776b6f
@ -250,7 +250,18 @@ namespace tunnel
|
|||||||
|
|
||||||
void InboundTunnel::HandleTunnelDataMsg (std::shared_ptr<I2NPMessage>&& msg)
|
void InboundTunnel::HandleTunnelDataMsg (std::shared_ptr<I2NPMessage>&& msg)
|
||||||
{
|
{
|
||||||
if (GetState () != eTunnelStateExpiring) SetState (eTunnelStateEstablished); // incoming messages means a tunnel is alive
|
if (!IsEstablished () && GetState () != eTunnelStateExpiring)
|
||||||
|
{
|
||||||
|
// incoming messages means a tunnel is alive
|
||||||
|
SetState (eTunnelStateEstablished);
|
||||||
|
auto pool = GetTunnelPool ();
|
||||||
|
if (pool)
|
||||||
|
{
|
||||||
|
// update LeaseSet
|
||||||
|
auto dest = pool->GetLocalDestination ();
|
||||||
|
if (dest) dest->SetLeaseSetUpdated ();
|
||||||
|
}
|
||||||
|
}
|
||||||
EncryptTunnelMsg (msg, msg);
|
EncryptTunnelMsg (msg, msg);
|
||||||
msg->from = GetSharedFromThis ();
|
msg->from = GetSharedFromThis ();
|
||||||
m_Endpoint.HandleDecryptedTunnelDataMsg (msg);
|
m_Endpoint.HandleDecryptedTunnelDataMsg (msg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user