Skip to content
Snippets Groups Projects
Commit 3d1e055c authored by Adrien Béraud's avatar Adrien Béraud
Browse files

peerdiscovery: always use local node id

parent b02e9cff
Branches
Tags 1.9.0
No related merge requests found
...@@ -161,9 +161,9 @@ DhtRunner::run(const SockAddr& local4, const SockAddr& local6, const DhtRunner:: ...@@ -161,9 +161,9 @@ DhtRunner::run(const SockAddr& local4, const SockAddr& local6, const DhtRunner::
} }
if (config.peer_publish) { if (config.peer_publish) {
if (peerDiscovery4_) if (peerDiscovery4_)
peerDiscovery4_->startPublish(getNodeId(), getBoundPort(AF_INET)); peerDiscovery4_->startPublish(dht_->getNodeId(), getBoundPort(AF_INET));
if (peerDiscovery6_) if (peerDiscovery6_)
peerDiscovery6_->startPublish(getNodeId(), getBoundPort(AF_INET6)); peerDiscovery6_->startPublish(dht_->getNodeId(), getBoundPort(AF_INET6));
} }
} }
...@@ -226,17 +226,17 @@ DhtRunner::dumpTables() const ...@@ -226,17 +226,17 @@ DhtRunner::dumpTables() const
InfoHash InfoHash
DhtRunner::getId() const DhtRunner::getId() const
{ {
if (!activeDht()) if (auto dht = activeDht())
return {}; return dht->getId();
return activeDht()->getId(); return {};
} }
InfoHash InfoHash
DhtRunner::getNodeId() const DhtRunner::getNodeId() const
{ {
if (!activeDht()) if (auto dht = activeDht())
return {}; return dht->getNodeId();
return activeDht()->getNodeId(); return {};
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment