1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add network id to dht (#559)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2022-12-20 14:26:39 +03:00 committed by GitHub
parent 15cdfb0462
commit 3ff50f5f47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 231 additions and 172 deletions

View file

@ -132,7 +132,9 @@ class Resolver : public td::actor::Actor {
if (!conf.dht_) {
return td::Status::Error(ton::ErrorCode::error, "does not contain [dht] section");
}
auto &nodes = conf.dht_->static_nodes_->nodes_;
ton::ton_api::dht_nodes* static_nodes = nullptr;
ton::ton_api::downcast_call(*conf.dht_, [&](auto &f) { static_nodes = f.static_nodes_.get(); });
auto &nodes = static_nodes->nodes_;
if (server_idx_ >= 0) {
CHECK(server_idx_ < (int)nodes.size());
LOG(INFO) << "Using server #" << server_idx_;