mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Remove unused PathDB
This commit is contained in:
@@ -806,7 +806,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\cpp\ripple\PathDB.cpp" />
|
||||
<ClCompile Include="src\cpp\ripple\Pathfinder.cpp" />
|
||||
<ClCompile Include="src\cpp\ripple\PaymentTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1520,7 +1519,6 @@
|
||||
<ClInclude Include="src\cpp\ripple\PackedMessage.h" />
|
||||
<ClInclude Include="src\cpp\ripple\ParameterTable.h" />
|
||||
<ClInclude Include="src\cpp\ripple\ParseSection.h" />
|
||||
<ClInclude Include="src\cpp\ripple\PathDB.h" />
|
||||
<ClInclude Include="src\cpp\ripple\Pathfinder.h" />
|
||||
<ClInclude Include="src\cpp\ripple\PaymentTransactor.h" />
|
||||
<ClInclude Include="src\cpp\ripple\Peer.h" />
|
||||
|
||||
@@ -403,9 +403,6 @@
|
||||
<ClCompile Include="src\cpp\ripple\NicknameState.cpp">
|
||||
<Filter>Unsorted Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\cpp\ripple\PathDB.cpp">
|
||||
<Filter>Unsorted Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\cpp\ripple\Pathfinder.cpp">
|
||||
<Filter>Unsorted Sources</Filter>
|
||||
</ClCompile>
|
||||
@@ -1038,9 +1035,6 @@
|
||||
<ClInclude Include="src\cpp\ripple\NicknameState.h">
|
||||
<Filter>Unsorted Sources</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\cpp\ripple\PathDB.h">
|
||||
<Filter>Unsorted Sources</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\cpp\ripple\Pathfinder.h">
|
||||
<Filter>Unsorted Sources</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "PathDB.h"
|
||||
@@ -1,87 +0,0 @@
|
||||
#ifndef PATHDB__H
|
||||
#define PATHBD__H
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "uint256.h"
|
||||
#include "TaggedCache.h"
|
||||
|
||||
typedef std::pair<uint160, uint160> currencyIssuer_t;
|
||||
|
||||
#ifdef C11X
|
||||
typedef std::pair<const uint160&, const uint160&> currencyIssuer_ct;
|
||||
#else
|
||||
typedef std::pair<uint160, uint160> currencyIssuer_ct;
|
||||
#endif
|
||||
|
||||
class PathDBEntry
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<PathDBEntry> pointer;
|
||||
typedef const pointer& ref;
|
||||
|
||||
static const unsigned int sIsExchange = 0x00001;
|
||||
static const unsigned int sIsOffer = 0x00002;
|
||||
static const unsigned int sIsDirty = 0x10000;
|
||||
|
||||
protected:
|
||||
currencyIssuer_t mIn;
|
||||
currencyIssuer_t mOut;
|
||||
uint32 mLastSeq;
|
||||
int mUseCount;
|
||||
unsigned mFlags;
|
||||
std::size_t mHash;
|
||||
|
||||
public:
|
||||
|
||||
void updateSeq(uint32);
|
||||
|
||||
const uint160& getCurrencyIn() const { return mIn.first; }
|
||||
const uint160& getIssuerIn() const { return mIn.second; }
|
||||
const uint160& getCurrencyOut() const { return mOut.first; }
|
||||
const uint160& getIssuerOut() const { return mOut.second; }
|
||||
|
||||
bool isExchange() const;
|
||||
bool isOffer() const;
|
||||
bool isDirty() const;
|
||||
};
|
||||
|
||||
class PathDB
|
||||
{
|
||||
protected:
|
||||
boost::recursive_mutex mLock;
|
||||
TaggedCache<currencyIssuer_t, PathDBEntry> mFromCache;
|
||||
TaggedCache<currencyIssuer_t, PathDBEntry> mToCache;
|
||||
// std::set<PathDBEntry::pointer> mDirtyPaths;
|
||||
|
||||
public:
|
||||
|
||||
PathDB();
|
||||
|
||||
std::vector<PathDBEntry::pointer> getPathsFrom(const uint160& currency, const uint160& issuer,
|
||||
int maxBestPaths = 10, int maxRandPaths = 10);
|
||||
|
||||
std::vector<PathDBEntry::pointer> getPathsTo(const uint160& currency, const uint160& issuer,
|
||||
int maxBestPaths = 10, int maxRandPaths = 10);
|
||||
|
||||
void usedLine(const uint160& currency, const uint160& accountIn, const uint160& accountOut);
|
||||
void usedExchange(const uint160& currencyFrom, const uint160& issuerFrom,
|
||||
const uint160& currencyTo, const uint160& issuerTo);
|
||||
};
|
||||
|
||||
#ifdef C11X
|
||||
extern std::size_t hash_value(const currencyIssuer_ct& ci)
|
||||
{
|
||||
std::size_t r = hash_value(ci.second);
|
||||
return ci.first.hash_combine(r);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline std::size_t hash_value(const currencyIssuer_t& ci)
|
||||
{
|
||||
std::size_t r = hash_value(ci.second);
|
||||
return ci.first.hash_combine(r);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user