mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
wait for confirmantion of publishing
This commit is contained in:
parent
3e3cfa3d68
commit
e1c25fedb0
4 changed files with 94 additions and 33 deletions
21
NetDb.cpp
21
NetDb.cpp
|
@ -896,26 +896,5 @@ namespace data
|
|||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
void NetDb::PublishLeaseSet (const LeaseSet * leaseSet, i2p::tunnel::TunnelPool * pool)
|
||||
{
|
||||
if (!leaseSet || !pool) return;
|
||||
auto outbound = pool->GetNextOutboundTunnel ();
|
||||
if (!outbound)
|
||||
{
|
||||
LogPrint ("Can't publish LeaseSet. No outbound tunnels");
|
||||
return;
|
||||
}
|
||||
std::set<IdentHash> excluded;
|
||||
auto floodfill = GetClosestFloodfill (leaseSet->GetIdentHash (), excluded);
|
||||
if (!floodfill)
|
||||
{
|
||||
LogPrint ("Can't publish LeaseSet. No floodfills found");
|
||||
return;
|
||||
}
|
||||
uint32_t replyToken = i2p::context.GetRandomNumberGenerator ().GenerateWord32 ();
|
||||
auto msg = pool->GetGarlicDestination ().WrapMessage (*floodfill, i2p::CreateDatabaseStoreMsg (leaseSet, replyToken));
|
||||
outbound->SendTunnelDataMsg (floodfill->GetIdentHash (), 0, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue