Skip to content

Commit

Permalink
publishing with flood
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jan 29, 2015
1 parent 679faf5 commit 938fa00
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions NetDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,14 @@ namespace data
void NetDb::Publish ()
{
std::set<IdentHash> excluded; // TODO: fill up later
for (int i = 0; i < 3; i++)
for (int i = 0; i < 2; i++)
{
auto floodfill = GetClosestFloodfill (i2p::context.GetRouterInfo ().GetIdentHash (), excluded);
if (floodfill)
{
LogPrint ("Publishing our RouterInfo to ", floodfill->GetIdentHashAbbreviation ());
transports.SendMessage (floodfill->GetIdentHash (), CreateDatabaseStoreMsg ());
uint32_t replyToken = i2p::context.GetRandomNumberGenerator ().GenerateWord32 ();
LogPrint ("Publishing our RouterInfo to ", floodfill->GetIdentHashAbbreviation (), ". reply token=", replyToken);
transports.SendMessage (floodfill->GetIdentHash (), CreateDatabaseStoreMsg ((RouterInfo *)nullptr, replyToken));
excluded.insert (floodfill->GetIdentHash ());
}
}
Expand Down

0 comments on commit 938fa00

Please sign in to comment.