Skip to content
Snippets Groups Projects
Commit b5cb38c2 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

datatransfer: remove useless publicAddresses call

This also fix a deadlock when calling this function inside a callback
called when no peer has been found.

Change-Id: I0a8af8fc7ccfa638fdae9da957275a578b43879e
parent 767900a2
Branches
No related tags found
No related merge requests found
......@@ -699,12 +699,11 @@ DhtPeerConnector::closeConnection(const std::string& peer_id, const DRing::DataT
// will be determined via the pair (dev_h, tid).
// That's why we need to call CANCEL for the peer_h and each dev_h.
const auto peer_h = dht::InfoHash(peer_id);
auto addresses = pimpl_->account.publicAddresses();
pimpl_->ctrl << makeMsg<CtrlMsgType::CANCEL>(peer_h, tid);
pimpl_->account.forEachDevice(
peer_h,
[this, addresses, tid](const std::shared_ptr<RingAccount>& account,
[this, tid](const std::shared_ptr<RingAccount>& account,
const dht::InfoHash& dev_h) {
if (dev_h == account->dht().getId()) {
RING_ERR() << account << "[CNX] no connection to yourself, bad person!";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment