mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 07:35:12 -04:00
added missing own id from group list, and removed possible duplicates in random group ids
This commit is contained in:
parent
269f9457be
commit
a69629cf73
2 changed files with 7 additions and 2 deletions
|
@ -2304,7 +2304,8 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
|
|||
ginfo.flag = gitem->flag ;
|
||||
ginfo.name = gitem->name ;
|
||||
ginfo.peerIds = gitem->pgpList.ids ;
|
||||
ginfo.id = RsNodeGroupId::random() ;
|
||||
|
||||
do { ginfo.id = RsNodeGroupId::random(); } while(groupList.find(ginfo.id) != groupList.end()) ;
|
||||
|
||||
// Ensure backward compatibility when loading the group in old format. The id must matchthe standard default id.
|
||||
|
||||
|
@ -2484,7 +2485,8 @@ bool p3PeerMgrIMPL::addGroup(RsGroupInfo &groupInfo)
|
|||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
groupInfo.id = RsNodeGroupId::random() ;//groupItem->id; // at creation time, we generate a random id.
|
||||
do { groupInfo.id = RsNodeGroupId::random(); } while(groupList.find(groupInfo.id) != groupList.end()) ;
|
||||
|
||||
RsGroupInfo groupItem(groupInfo) ;
|
||||
|
||||
// remove standard flag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue