diff --git a/libretroshare/src/services/p3gxsreputation.cc b/libretroshare/src/services/p3gxsreputation.cc index a475a5fab..943569732 100644 --- a/libretroshare/src/services/p3gxsreputation.cc +++ b/libretroshare/src/services/p3gxsreputation.cc @@ -360,11 +360,12 @@ bool p3GxsReputation::updateLatestUpdate(RsPeerId peerid, time_t ts) { RsStackMutex stack(mReputationMtx); /****** LOCKED MUTEX *******/ - std::map::iterator it; - it = mConfig.find(peerid); - if (it != mConfig.end()) + std::map::iterator it = mConfig.find(peerid); + + if (it == mConfig.end()) { - mConfig[peerid] = ReputationConfig(peerid); + mConfig[peerid] = ReputationConfig(peerid); + it = mConfig.find(peerid) ; } it->second.mLatestUpdate = ts;