diff --git a/include/opendht/dht.h b/include/opendht/dht.h index ee2554c5ff6fa2c4ccbb235a857c762a6b8dcd1c..31bc552059e571bea73099de5aec12017576a03b 100644 --- a/include/opendht/dht.h +++ b/include/opendht/dht.h @@ -78,9 +78,9 @@ public: virtual ~Dht(); /** - * Get the ID of the node, which was provided in the constructor. + * Get the ID of the node. */ - inline const InfoHash& getId() const { return myid; } + inline const InfoHash& getNodeId() const { return myid; } /** * Get the current status of the node for the given family. diff --git a/include/opendht/dhtrunner.h b/include/opendht/dhtrunner.h index cc3a5583d4a722244a7dfaf3284404cf1cf63a1c..8998e62c7b1ba66ed851cc11360f49ae8b431967 100644 --- a/include/opendht/dhtrunner.h +++ b/include/opendht/dhtrunner.h @@ -150,10 +150,15 @@ public: return dht_->getId(); } - InfoHash getRoutingId() const { + InfoHash getNodeId() const { if (!dht_) return {}; - return dht_->getRoutingId(); + return dht_->getNodeId(); + } + + //[[deprecated]] + InfoHash getRoutingId() const { + return getNodeId(); } std::vector<Dht::NodeExport> exportNodes() const { diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h index e128347a3ff74b51a2ceea44f1134f1110d39be7..d1e29a37db6f153d87f5d33211cd5291efd770dc 100644 --- a/include/opendht/securedht.h +++ b/include/opendht/securedht.h @@ -61,10 +61,6 @@ public: return key_->getPublicKey().getId(); } - InfoHash getRoutingId() const { - return Dht::getId(); - } - ValueType secureType(ValueType&& type); ValueType secureType(const ValueType& type) { diff --git a/tools/dhtchat.cpp b/tools/dhtchat.cpp index a016be9649326c3d433d3836a165c677361becb1..763e58af430d1800b23bd4a1e1f1dc35c6126f8c 100644 --- a/tools/dhtchat.cpp +++ b/tools/dhtchat.cpp @@ -82,7 +82,7 @@ main(int argc, char **argv) i += 2; } - std::cout << "OpenDht node " << dht.getRoutingId() << " running on port " << port<< std::endl; + std::cout << "OpenDht node " << dht.getNodeId() << " running on port " << port<< std::endl; std::cout << "Public key ID " << dht.getId() << std::endl; std::cout << " type 'c {hash}' to join a channel" << std::endl << std::endl; diff --git a/tools/dhtnode.cpp b/tools/dhtnode.cpp index fea36c3db60cc74cb12dc2901319819231e8bd69..8007878e8fa11001b158737aaaa8e5ce261f0009 100644 --- a/tools/dhtnode.cpp +++ b/tools/dhtnode.cpp @@ -113,7 +113,7 @@ main(int argc, char **argv) i += 2; } - std::cout << "OpenDht node " << dht.getRoutingId() << " running on port " << port<< std::endl; + std::cout << "OpenDht node " << dht.getNodeId() << " running on port " << port<< std::endl; std::cout << "Public key ID " << dht.getId() << std::endl; std::cout << " (type 'h' or 'help' for a list of possible commands)" << std::endl << std::endl;