Skip to content

Commit

Permalink
Check peers prior to saving it to local db (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyCheese authored Oct 12, 2023
1 parent cdf96a2 commit ddd3d44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion overlay/overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ void OverlayImpl::alarm() {
if (peers_.size() > 0) {
std::vector<OverlayNode> vec;
for (td::uint32 i = 0; i < 20; i++) {
vec.push_back(get_random_peer()->get());
auto P = get_random_peer();
if (!P) {
break;
}
vec.push_back(P->get());
}
td::actor::send_closure(manager_, &OverlayManager::save_to_db, local_id_, overlay_id_, std::move(vec));
}
Expand Down

0 comments on commit ddd3d44

Please sign in to comment.