diff --git a/NetDb.cpp b/NetDb.cpp index 3d8a4212..1fd0c130 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -335,19 +335,25 @@ namespace data if (inbound) { RequestedDestination * dest = CreateRequestedDestination (destination, isLeaseSet); - auto floodfill = GetClosestFloodfill (destination, dest->GetExcludedPeers ()); - if (floodfill) + std::vector msgs; + // request 3 closests floodfills + for (int i = 0; i < 3; i++) + { + auto floodfill = GetClosestFloodfill (destination, dest->GetExcludedPeers ()); + if (floodfill) + { + // DatabaseLookup message + msgs.push_back (i2p::tunnel::TunnelMessageBlock + { + i2p::tunnel::eDeliveryTypeRouter, + floodfill->GetIdentHash (), 0, + dest->CreateRequestMessage (floodfill, inbound) + }); + } + } + if (msgs.size () > 0) { - std::vector msgs; - // DatabaseLookup message dest->SetLastOutboundTunnel (outbound); - msgs.push_back (i2p::tunnel::TunnelMessageBlock - { - i2p::tunnel::eDeliveryTypeRouter, - floodfill->GetIdentHash (), 0, - dest->CreateRequestMessage (floodfill, inbound) - }); - outbound->SendTunnelDataMsg (msgs); } else diff --git a/Streaming.cpp b/Streaming.cpp index eb942bd5..5e99cca8 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -409,7 +409,7 @@ namespace stream } Sign (buf, size, buf+ size); size += 40; // signature - + LogPrint ("Local LeaseSet of ", tunnels.size (), " leases created"); m->len += size + sizeof (I2NPDatabaseStoreMsg); FillI2NPMessageHeader (m, eI2NPDatabaseStore); return m; diff --git a/Tunnel.cpp b/Tunnel.cpp index e199a8d3..c32c5e0e 100644 --- a/Tunnel.cpp +++ b/Tunnel.cpp @@ -131,6 +131,7 @@ namespace tunnel void InboundTunnel::HandleTunnelDataMsg (I2NPMessage * msg) { + if (IsFailed ()) SetFailed (false); // incoming messages means a tunnel is alive msg->from = this; EncryptTunnelMsg (msg); m_Endpoint.HandleDecryptedTunnelDataMsg (msg);