mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-15 04:32:21 +00:00
Fix choosing neighbours in private overlays (#1004)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
539d5dd2de
commit
d80ce8d3eb
1 changed files with 2 additions and 2 deletions
|
@ -229,7 +229,7 @@ void OverlayImpl::update_neighbours(td::uint32 nodes_to_change) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (X->get_version() <= td::Clocks::system() - 600) {
|
if (public_ && X->get_version() <= td::Clocks::system() - 600) {
|
||||||
if (X->is_neighbour()) {
|
if (X->is_neighbour()) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (auto &n : neighbours_) {
|
for (auto &n : neighbours_) {
|
||||||
|
@ -301,7 +301,7 @@ void OverlayImpl::get_overlay_random_peers(td::uint32 max_peers,
|
||||||
auto t = td::Clocks::system();
|
auto t = td::Clocks::system();
|
||||||
while (v.size() < max_peers && v.size() < peers_.size() - bad_peers_.size()) {
|
while (v.size() < max_peers && v.size() < peers_.size() - bad_peers_.size()) {
|
||||||
auto P = peers_.get_random();
|
auto P = peers_.get_random();
|
||||||
if (P->get_version() + 3600 < t) {
|
if (public_ && P->get_version() + 3600 < t) {
|
||||||
VLOG(OVERLAY_INFO) << this << ": deleting outdated peer " << P->get_id();
|
VLOG(OVERLAY_INFO) << this << ": deleting outdated peer " << P->get_id();
|
||||||
del_peer(P->get_id());
|
del_peer(P->get_id());
|
||||||
} else if (P->is_alive()) {
|
} else if (P->is_alive()) {
|
||||||
|
|
Loading…
Reference in a new issue