diff --git a/src/jamidht/conversation_module.cpp b/src/jamidht/conversation_module.cpp index 841ded0512526e5f5b0d7815d370f6fa59dec5d5..cd0fbae0982edfe727be463e8efdd6f9c920e174 100644 --- a/src/jamidht/conversation_module.cpp +++ b/src/jamidht/conversation_module.cpp @@ -403,6 +403,7 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer, conversationId.c_str()); return; } + syncCnt.fetch_add(1); onNeedSocket_(conversationId, deviceId, [this, @@ -416,10 +417,10 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer, || !conversation->second) { std::lock_guard<std::mutex> lk(pendingConversationsFetchMtx_); stopFetch(conversationId, deviceId); + syncCnt.fetch_sub(1); return false; } acc->addGitSocket(channel->deviceId(), conversationId, channel); - syncCnt.fetch_add(1); conversation->second->sync( peer, deviceId,