enables readding a group key by

This commit is contained in:
erqan 2016-09-29 18:33:10 +03:00
parent d214994b12
commit baf5be5c13

View File

@ -1206,7 +1206,7 @@ string getGroupAliasByKey(const string &privKey)
void registerNewGroup(const string &privKey, const string &desc, const string &member, const string &invitedBy, int64_t utcTime, int k) void registerNewGroup(const string &privKey, const string &desc, const string &member, const string &invitedBy, int64_t utcTime, int k)
{ {
string groupAlias = getGroupAliasByKey(privKey); string groupAlias = getGroupAliasByKey(privKey);
if( !groupAlias.length() ) {
CBitcoinSecret vchSecret; CBitcoinSecret vchSecret;
bool fGood = vchSecret.SetString(privKey); bool fGood = vchSecret.SetString(privKey);
if (!fGood) { if (!fGood) {
@ -1225,7 +1225,7 @@ void registerNewGroup(const string &privKey, const string &desc, const string &m
printf("registerGroupMember: Invalid group alias '%s' from wallet\n", groupAlias.c_str()); printf("registerGroupMember: Invalid group alias '%s' from wallet\n", groupAlias.c_str());
return; return;
} }
} else { } else if (!groupAlias.length()) {
groupAlias = getRandomGroupAlias(); groupAlias = getRandomGroupAlias();
} }
@ -1235,7 +1235,6 @@ void registerNewGroup(const string &privKey, const string &desc, const string &m
return; return;
} }
} }
}
LOCK(cs_twister); LOCK(cs_twister);
GroupChat &group = m_groups[groupAlias]; GroupChat &group = m_groups[groupAlias];