fixed stupid bug that crashed the code in a different place

This commit is contained in:
csoler 2019-05-27 21:48:47 +02:00
parent 4eb6b0b066
commit 8fddb559b9
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -944,7 +944,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
#endif #endif
std::map<RsPeerId, peerState>::iterator it; std::map<RsPeerId, peerState>::iterator it;
if (mFriendList.end() != mFriendList.find(id)) if (mFriendList.end() != (it=mFriendList.find(id)))
{ {
#ifdef PEER_DEBUG #ifdef PEER_DEBUG
std::cerr << "p3PeerMgrIMPL::addFriend() Already Exists" << std::endl; std::cerr << "p3PeerMgrIMPL::addFriend() Already Exists" << std::endl;
@ -1029,8 +1029,8 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
pstate.netMode = netMode; pstate.netMode = netMode;
pstate.lastcontact = lastContact; pstate.lastcontact = lastContact;
it->second.gpg_id = input_gpg_id; pstate.gpg_id = input_gpg_id;
it->second.skip_pgp_signature_validation = false; pstate.skip_pgp_signature_validation = false;
/* addr & timestamps -> auto cleared */ /* addr & timestamps -> auto cleared */
@ -1821,7 +1821,7 @@ bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8
{ {
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
uint32_t count ; uint32_t count =0;
locked_computeCurrentBestOwnExtAddressCandidate(addr,count) ; locked_computeCurrentBestOwnExtAddressCandidate(addr,count) ;