| 531 | } |
| 532 | |
| 533 | void LeaseSetDestination::HandleDatabaseSearchReplyMessage (const uint8_t * buf, size_t len) |
| 534 | { |
| 535 | i2p::data::IdentHash key (buf); |
| 536 | int num = buf[32]; // num |
| 537 | LogPrint (eLogDebug, "Destination: DatabaseSearchReply for ", key.ToBase64 (), " num=", num); |
| 538 | auto it = m_LeaseSetRequests.find (key); |
| 539 | if (it != m_LeaseSetRequests.end ()) |
| 540 | { |
| 541 | auto request = it->second; |
| 542 | for (int i = 0; i < num; i++) |
| 543 | { |
| 544 | i2p::data::IdentHash peerHash (buf + 33 + i*32); |
| 545 | if (!request->excluded.count (peerHash) && !i2p::data::netdb.FindRouter (peerHash)) |
| 546 | { |
| 547 | LogPrint (eLogInfo, "Destination: Found new floodfill, request it"); |
| 548 | i2p::data::netdb.RequestDestination (peerHash, nullptr, false); // through exploratory |
| 549 | } |
| 550 | } |
| 551 | SendNextLeaseSetRequest (key, request); |
| 552 | } |
| 553 | else |
| 554 | LogPrint (eLogWarning, "Destination: Request for ", key.ToBase64 (), " not found"); |
| 555 | } |
| 556 | |
| 557 | void LeaseSetDestination::SendNextLeaseSetRequest (const i2p::data::IdentHash& key, |
| 558 | std::shared_ptr<LeaseSetRequest> request) |
nothing calls this directly
no test coverage detected