Browse Source

publishing with flood

pull/151/head
orignal 10 years ago
parent
commit
938fa00469
  1. 7
      NetDb.cpp

7
NetDb.cpp

@ -735,13 +735,14 @@ namespace data
void NetDb::Publish () void NetDb::Publish ()
{ {
std::set<IdentHash> excluded; // TODO: fill up later 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); auto floodfill = GetClosestFloodfill (i2p::context.GetRouterInfo ().GetIdentHash (), excluded);
if (floodfill) if (floodfill)
{ {
LogPrint ("Publishing our RouterInfo to ", floodfill->GetIdentHashAbbreviation ()); uint32_t replyToken = i2p::context.GetRandomNumberGenerator ().GenerateWord32 ();
transports.SendMessage (floodfill->GetIdentHash (), CreateDatabaseStoreMsg ()); LogPrint ("Publishing our RouterInfo to ", floodfill->GetIdentHashAbbreviation (), ". reply token=", replyToken);
transports.SendMessage (floodfill->GetIdentHash (), CreateDatabaseStoreMsg ((RouterInfo *)nullptr, replyToken));
excluded.insert (floodfill->GetIdentHash ()); excluded.insert (floodfill->GetIdentHash ());
} }
} }

Loading…
Cancel
Save