mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-10 14:58:05 +00:00
fix deadlock
This commit is contained in:
parent
6594b01e6f
commit
22161a71ed
@ -69,8 +69,10 @@ sha1_hash dhtTargetHash(std::string const &username, std::string const &resource
|
||||
|
||||
torrent_handle startTorrentUser(std::string const &username)
|
||||
{
|
||||
bool userInTxDb = usernameExists(username); // keep this outside cs_twister to avoid deadlock
|
||||
|
||||
LOCK(cs_twister);
|
||||
if( !m_userTorrent.count(username) && usernameExists(username) ) {
|
||||
if( !m_userTorrent.count(username) && userInTxDb ) {
|
||||
sha1_hash ih = dhtTargetHash(username, "tracker", "m");
|
||||
|
||||
printf("adding torrent for [%s,tracker]\n", username.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user