some fixes

- id pull now works (Peer A, Peer B test)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs_finale@6889 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2013-11-04 14:09:32 +00:00
parent 67c55991d7
commit cf8a63888b
7 changed files with 42 additions and 13 deletions

View file

@ -176,7 +176,7 @@ class RsGixsReputation
public:
// get Reputation.
virtual bool haveReputation(const RsGxsId &id) = 0;
virtual bool loadReputation(const RsGxsId &id) = 0;
virtual bool loadReputation(const RsGxsId &id, const std::list<std::string>& peers) = 0;
virtual bool getReputation(const RsGxsId &id, GixsReputation &rep) = 0;
};

View file

@ -1263,6 +1263,9 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
MsgAuthorV toVet;
std::list<std::string> peers;
peers.push_back(tr->mTransaction->PeerId());
for(; llit != msgItemL.end(); llit++)
{
RsNxsSyncMsgItem*& syncItem = *llit;
@ -1289,7 +1292,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
else
{
// preload for speed
mReputations->loadReputation(syncItem->authorId);
mReputations->loadReputation(syncItem->authorId, peers);
MsgAuthEntry entry;
entry.mAuthorId = syncItem->authorId;
entry.mGrpId = syncItem->grpId;
@ -1380,6 +1383,8 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
uint32_t transN = locked_getTransactionId();
GrpAuthorV toVet;
std::list<std::string> peers;
peers.push_back(tr->mTransaction->PeerId());
for(; llit != grpItemL.end(); llit++)
{
@ -1413,7 +1418,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
else
{
// preload reputation for later
mReputations->loadReputation(grpSyncItem->authorId);
mReputations->loadReputation(grpSyncItem->authorId, peers);
GrpAuthEntry entry;
entry.mAuthorId = grpSyncItem->authorId;
entry.mGrpId = grpSyncItem->grpId;

View file

@ -47,14 +47,16 @@ bool AuthorPending::expired() const
}
bool AuthorPending::getAuthorRep(GixsReputation& rep,
const std::string& authorId)
const std::string& authorId, const std::string& peerId)
{
if(mRep->haveReputation(authorId))
{
return mRep->getReputation(authorId, rep);
}
mRep->loadReputation(authorId);
std::list<std::string> peers;
peers.push_back(peerId);
mRep->loadReputation(authorId, peers);
return false;
}
@ -94,7 +96,7 @@ bool MsgRespPending::accepted()
if(!entry.mPassedVetting)
{
GixsReputation rep;
if(getAuthorRep(rep, entry.mAuthorId))
if(getAuthorRep(rep, entry.mAuthorId, mPeerId))
{
if(rep.score > mCutOff)
{
@ -129,7 +131,7 @@ bool GrpRespPending::accepted()
{
GixsReputation rep;
if(getAuthorRep(rep, entry.mAuthorId))
if(getAuthorRep(rep, entry.mAuthorId, mPeerId))
{
if(rep.score > mCutOff)
{

View file

@ -141,7 +141,7 @@ protected:
* @param authorId reputation to get
* @return true if successfully retrieve repution
*/
bool getAuthorRep(GixsReputation& rep, const std::string& authorId);
bool getAuthorRep(GixsReputation& rep, const std::string& authorId, const std::string& peerId);
private: