don't start torrent for nonexistent users. (we will need something different for #hashtags)

This commit is contained in:
Miguel Freitas 2013-10-30 20:57:49 -02:00
parent defb9a13a3
commit 3ac54ffbe9

View File

@ -70,7 +70,7 @@ sha1_hash dhtTargetHash(std::string const &username, std::string const &resource
torrent_handle startTorrentUser(std::string const &username) torrent_handle startTorrentUser(std::string const &username)
{ {
LOCK(cs_twister); LOCK(cs_twister);
if( !m_userTorrent.count(username) ) { if( !m_userTorrent.count(username) && usernameExists(username) ) {
sha1_hash ih = dhtTargetHash(username, "tracker", "m"); sha1_hash ih = dhtTargetHash(username, "tracker", "m");
printf("adding torrent for [%s,tracker]\n", username.c_str()); printf("adding torrent for [%s,tracker]\n", username.c_str());