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:
parent
15cdfb0462
commit
3ff50f5f47
15 changed files with 231 additions and 172 deletions
11
dht/dht.hpp
11
dht/dht.hpp
|
@ -52,15 +52,20 @@ class DhtGlobalConfig {
|
|||
auto get_a() const {
|
||||
return a_;
|
||||
}
|
||||
auto get_network_id() const {
|
||||
return network_id_;
|
||||
}
|
||||
const auto &nodes() const {
|
||||
return static_nodes_;
|
||||
}
|
||||
DhtGlobalConfig(td::uint32 k, td::uint32 a, DhtNodesList nodes) : k_(k), a_(a), static_nodes_(std::move(nodes)) {
|
||||
DhtGlobalConfig(td::uint32 k, td::uint32 a, td::int32 network_id, DhtNodesList nodes)
|
||||
: k_(k), a_(a), network_id_(network_id), static_nodes_(std::move(nodes)) {
|
||||
}
|
||||
|
||||
private:
|
||||
td::uint32 k_;
|
||||
td::uint32 a_;
|
||||
td::int32 network_id_;
|
||||
DhtNodesList static_nodes_;
|
||||
};
|
||||
|
||||
|
@ -85,8 +90,8 @@ class DhtMember : public Dht {
|
|||
|
||||
static td::actor::ActorOwn<DhtMember> create(adnl::AdnlNodeIdShort id, std::string db_root,
|
||||
td::actor::ActorId<keyring::Keyring> keyring,
|
||||
td::actor::ActorId<adnl::Adnl> adnl, td::uint32 k = 10, td::uint32 a = 3,
|
||||
bool client_only = false);
|
||||
td::actor::ActorId<adnl::Adnl> adnl, td::int32 network_id,
|
||||
td::uint32 k = 10, td::uint32 a = 3, bool client_only = false);
|
||||
|
||||
//virtual void update_addr_list(tl_object_ptr<ton_api::adnl_addressList> addr_list) = 0;
|
||||
//virtual void add_node(adnl::AdnlNodeIdShort id) = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue