File tree 3 files changed +6
-10
lines changed
3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,8 @@ void OverlayImpl::update_neighbours(td::uint32 nodes_to_change) {
407
407
continue ;
408
408
}
409
409
410
- if (X->get_version () <= td::Clocks::system () - Overlays::overlay_peer_ttl ()) {
410
+ if (overlay_type_ != OverlayType::FixedMemberList && X->get_version () <= td::Clocks::system () -
411
+ Overlays::overlay_peer_ttl ()) {
411
412
if (X->is_permanent_member ()) {
412
413
del_from_neighbour_list (X);
413
414
} else {
@@ -656,14 +657,9 @@ size_t OverlayImpl::neighbours_cnt() const {
656
657
657
658
void OverlayImpl::update_root_member_list (std::vector<adnl::AdnlNodeIdShort> ids,
658
659
std::vector<PublicKeyHash> root_public_keys, OverlayMemberCertificate cert) {
659
- td::uint32 expectd_size =
660
+ auto expected_size =
660
661
(td::uint32)(ids.size () + root_public_keys.size () * opts_.max_slaves_in_semiprivate_overlay_ );
661
- if (expectd_size > opts_.max_peers_ ) {
662
- opts_.max_peers_ = expectd_size;
663
- }
664
- if (expectd_size > opts_.max_neighbours_ ) {
665
- opts_.max_neighbours_ = expectd_size;
666
- }
662
+ opts_.max_peers_ = std::max (opts_.max_peers_ , expected_size);
667
663
std::sort (ids.begin (), ids.end ());
668
664
auto old_root_public_keys = std::move (peer_list_.root_public_keys_ );
669
665
for (const auto &pub_key : root_public_keys) {
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class Overlay : public td::actor::Actor {
78
78
bool is_response) = 0;
79
79
virtual void update_peer_ip_str (adnl::AdnlNodeIdShort peer_id, td::string ip_str) = 0;
80
80
virtual void update_member_certificate (OverlayMemberCertificate cert) = 0;
81
- virtual void update_root_member_list (std::vector<adnl::AdnlNodeIdShort> nodes ,
81
+ virtual void update_root_member_list (std::vector<adnl::AdnlNodeIdShort> ids ,
82
82
std::vector<PublicKeyHash> root_public_keys, OverlayMemberCertificate cert) = 0;
83
83
// virtual void receive_broadcast(td::BufferSlice data) = 0;
84
84
// virtual void subscribe(std::unique_ptr<Overlays::Callback> callback) = 0;
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ class OverlayImpl : public Overlay {
280
280
281
281
void update_peer_ip_str (adnl::AdnlNodeIdShort peer_id, td::string ip_str) override ;
282
282
283
- void update_root_member_list (std::vector<adnl::AdnlNodeIdShort> nodes , std::vector<PublicKeyHash> root_public_keys,
283
+ void update_root_member_list (std::vector<adnl::AdnlNodeIdShort> ids , std::vector<PublicKeyHash> root_public_keys,
284
284
OverlayMemberCertificate cert) override ;
285
285
286
286
bool is_valid_peer (const adnl::AdnlNodeIdShort &id, const ton_api::overlay_MemberCertificate *certificate);
You can’t perform that action at this time.
0 commit comments