mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
subscribe to LeaseSet
This commit is contained in:
parent
ce722e7a5e
commit
1545a21682
3 changed files with 38 additions and 10 deletions
|
@ -156,7 +156,7 @@ namespace util
|
|||
auto leaseSet = i2p::data::netdb.FindLeaseSet (destination);
|
||||
if (!leaseSet || !leaseSet->HasNonExpiredLeases ())
|
||||
{
|
||||
i2p::data::netdb.RequestDestination (i2p::data::IdentHash (destination), true);
|
||||
i2p::data::netdb.Subscribe(destination);
|
||||
std::this_thread::sleep_for (std::chrono::seconds(10)); // wait for 10 seconds
|
||||
leaseSet = i2p::data::netdb.FindLeaseSet (destination);
|
||||
if (!leaseSet || !leaseSet->HasNonExpiredLeases ()) // still no LeaseSet
|
||||
|
@ -170,13 +170,6 @@ namespace util
|
|||
return;
|
||||
}
|
||||
}
|
||||
// we found LeaseSet
|
||||
if (leaseSet->HasExpiredLeases ())
|
||||
{
|
||||
// we should re-request LeaseSet
|
||||
LogPrint ("LeaseSet re-requested");
|
||||
i2p::data::netdb.RequestDestination (i2p::data::IdentHash (destination), true);
|
||||
}
|
||||
auto s = i2p::stream::CreateStream (leaseSet);
|
||||
if (s)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue