diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index 4d01aace0c7fc7f08154d549b64290f90f5d3659..cbf1c3a3460812d667fceeb60853555761cb3591 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -3729,19 +3729,6 @@ JamiAccount::storeActiveIpAddress() } } -std::vector<std::string> -JamiAccount::publicAddresses() -{ - std::vector<std::string> addresses; - for (auto& addr : dht_->getPublicAddress(AF_INET)) { - addresses.emplace_back(addr.toString()); - } - for (auto& addr : dht_->getPublicAddress(AF_INET6)) { - addresses.emplace_back(addr.toString()); - } - return addresses; -} - void JamiAccount::requestPeerConnection( const std::string& peer_id, diff --git a/src/jamidht/jamiaccount.h b/src/jamidht/jamiaccount.h index 103bc2e64fb1e6de843aa7898dd0daade96a0221..434e43f804c89a41a3572d51e0215546e2d843ca 100644 --- a/src/jamidht/jamiaccount.h +++ b/src/jamidht/jamiaccount.h @@ -394,8 +394,6 @@ public: /// void closePeerConnection(const DRing::DataTransferId& tid); - std::vector<std::string> publicAddresses(); - /// \return true if the given DHT message identifier has been treated /// \note if message has not been treated yet this method store this id and returns true at /// further calls diff --git a/src/jamidht/p2p.cpp b/src/jamidht/p2p.cpp index 4df8168ca8e087b7814f4b0221435bc752cf05ff..6c8fdb66bff4ed25e5534104392da99959afb4df 100644 --- a/src/jamidht/p2p.cpp +++ b/src/jamidht/p2p.cpp @@ -274,18 +274,9 @@ DhtPeerConnector::requestConnection( return; } - // Notes for reader: - // 1) dht.getPublicAddress() suffers of a non-usability into forEachDevice() callbacks. - // If you call it in forEachDevice callbacks, it'll never not return... - // Seems that getPublicAddress() and forEachDevice() need to process into the same thread - // (here the one where dht_ loop runs). - // 2) anyway its good to keep this processing here in case of multiple device - // as the result is the same for each device. - auto addresses = acc->publicAddresses(); - acc->forEachDevice( peer_h, - [this, addresses, tid, channelReadyCb = std::move(channelReadyCb)]( + [this, tid, channelReadyCb = std::move(channelReadyCb)]( const dht::InfoHash& dev_h) { auto acc = pimpl_->account.lock(); if (!acc)