Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gxs/rsgxsnettunnel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,10 @@ void RsGxsNetTunnelService::getStatistics(
bias = mRandomBias ;
}

bool RsGxsNetTunnelService::isGXSHash(RsFileHash hash) const
{
return mHandledHashes.find(hash) != mHandledHashes.end();
}



Expand Down
2 changes: 2 additions & 0 deletions src/gxs/rsgxsnettunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ class RsGxsNetTunnelService:
std::map<TurtleVirtualPeerId,RsGxsNetTunnelVirtualPeerId>& turtle_vpid_to_net_tunnel_vpid,
Bias20Bytes& bias) const override ;

bool isGXSHash(RsFileHash hash) const;

RS_DEPRECATED
TurtleRequestId turtleSearchRequest(
const std::string& match_string,
Expand Down
1 change: 1 addition & 0 deletions src/retroshare/rsgxsdistsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class RsGxsDistSync
std::map<TurtleVirtualPeerId,RsGxsNetTunnelVirtualPeerId>& turtle_vpid_to_net_tunnel_vpid,
Bias20Bytes& bias
) const =0;
virtual bool isGXSHash(RsFileHash hash) const =0;
};

extern RsGxsDistSync *rsGxsDistSync ;
Expand Down
7 changes: 7 additions & 0 deletions src/turtle/p3turtle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "pqi/authssl.h"
#include "pqi/p3linkmgr.h"
#include "retroshare/rspeers.h"
#include <retroshare/rsgxsdistsync.h>

#include "ft/ftserver.h"
#include "ft/ftdatamultiplex.h"
Expand Down Expand Up @@ -2372,6 +2373,9 @@ void p3turtle::getInfo( std::vector<std::vector<std::string> >& hashes_info,

for(std::map<TurtleFileHash,TurtleHashInfo>::const_iterator it(_incoming_file_hashes.begin());it!=_incoming_file_hashes.end();++it)
{
if(rsGxsDistSync->isGXSHash(it->first))
continue;

hashes_info.push_back(std::vector<std::string>()) ;

std::vector<std::string>& hashes(hashes_info.back()) ;
Expand All @@ -2387,6 +2391,9 @@ void p3turtle::getInfo( std::vector<std::vector<std::string> >& hashes_info,

for(std::map<TurtleTunnelId,TurtleTunnel>::const_iterator it(_local_tunnels.begin());it!=_local_tunnels.end();++it)
{
if(rsGxsDistSync->isGXSHash(it->second.hash))
continue;

tunnels_info.push_back(std::vector<std::string>()) ;
std::vector<std::string>& tunnel(tunnels_info.back()) ;

Expand Down