mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Remove unused Validator files
This commit is contained in:
@@ -796,12 +796,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\ripple_core\validator\Validator.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\ripple_core\validator\Validators.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -1519,7 +1513,6 @@
|
||||
<ClInclude Include="..\..\modules\ripple_core\test\StateBase.h" />
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\ValidatorSourceStrings.h" />
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\ValidatorSourceTrustedUri.h" />
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\Validator.h" />
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\ValidatorsImp.h" />
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\Validators.h" />
|
||||
<ClInclude Include="..\..\modules\ripple_data\crypto\ripple_Base58.h" />
|
||||
|
||||
@@ -861,9 +861,6 @@
|
||||
<ClCompile Include="..\..\modules\ripple_core\validator\ValidatorSourceTrustedUri.cpp">
|
||||
<Filter>[1] Ripple\ripple_core\validator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\ripple_core\validator\Validator.cpp">
|
||||
<Filter>[1] Ripple\ripple_core\validator</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\ripple_core\validator\Validators.cpp">
|
||||
<Filter>[1] Ripple\ripple_core\validator</Filter>
|
||||
</ClCompile>
|
||||
@@ -1682,9 +1679,6 @@
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\ValidatorSourceTrustedUri.h">
|
||||
<Filter>[1] Ripple\ripple_core\validator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\Validator.h">
|
||||
<Filter>[1] Ripple\ripple_core\validator</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\ripple_core\validator\Validators.h">
|
||||
<Filter>[1] Ripple\ripple_core\validator</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "../ripple_leveldb/ripple_leveldb.h"
|
||||
#include "../ripple_mdb/ripple_mdb.h"
|
||||
|
||||
// For Validators
|
||||
//#include "../ripple_net/ripple_net.h"
|
||||
|
||||
namespace ripple
|
||||
{
|
||||
|
||||
@@ -59,8 +62,6 @@ namespace ripple
|
||||
# include "test/ConfigType.h"
|
||||
#include "test/TestOverlay.cpp"
|
||||
|
||||
# include "validator/Validator.h"
|
||||
#include "validator/Validator.cpp"
|
||||
# include "validator/ValidatorSourceStrings.h"
|
||||
# include "validator/ValidatorSourceTrustedUri.h"
|
||||
# include "validator/ValidatorsImp.h" // private
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
Validator::Validator (RipplePublicKey const& publicKey)
|
||||
: m_publicKey (publicKey)
|
||||
{
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_CORE_VALIDATOR_VALIDATOR_H_INCLUDED
|
||||
#define RIPPLE_CORE_VALIDATOR_VALIDATOR_H_INCLUDED
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Identifies a validator.
|
||||
|
||||
A validator signs ledgers and participates in the consensus process.
|
||||
These are kept in a map so we can retrieve a unique Validator object
|
||||
given the public key in the ValidatorInfo.
|
||||
*/
|
||||
class Validator : public SharedObject
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr <Validator> Ptr;
|
||||
|
||||
/** Fixed information on a validator.
|
||||
|
||||
This describes a validator.
|
||||
*/
|
||||
struct Info
|
||||
{
|
||||
struct Compare
|
||||
{
|
||||
static int compareElements (Info const& lhs, Info const& rhs)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (lhs.publicKey < rhs.publicKey)
|
||||
result = -1;
|
||||
else if (lhs.publicKey > rhs.publicKey)
|
||||
result = 1;
|
||||
else
|
||||
result = 0;
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
RipplePublicKey publicKey;
|
||||
//String friendlyName;
|
||||
//String organizationType;
|
||||
//String jurisdicton;
|
||||
|
||||
static void sortAndRemoveDuplicates (Array <Info>& arrayToSort)
|
||||
{
|
||||
Array <Info> sorted;
|
||||
|
||||
sorted.ensureStorageAllocated (arrayToSort.size ());
|
||||
|
||||
for (int i = 0; i < arrayToSort.size (); ++i)
|
||||
{
|
||||
Compare compare;
|
||||
|
||||
int const index = sorted.addSorted (compare, arrayToSort [i]);
|
||||
|
||||
if (index > 0 && Compare::compareElements (sorted [index], sorted [index-1]) == 0)
|
||||
{
|
||||
// duplicate
|
||||
sorted.remove (index);
|
||||
}
|
||||
}
|
||||
|
||||
arrayToSort.swapWith (sorted);
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// Comparison function for Validator objects
|
||||
//
|
||||
struct Compare
|
||||
{
|
||||
static int compareElements (Validator const* lhs, Validator const* rhs)
|
||||
{
|
||||
return lhs->getPublicKey().compare (rhs->getPublicKey ());
|
||||
}
|
||||
};
|
||||
|
||||
/** A list of Validator that comes from a source of validators.
|
||||
|
||||
Sources include trusted URIs, or a local file. The list may be
|
||||
signed.
|
||||
|
||||
@note The list is immutable and guaranteed to be sorted.
|
||||
*/
|
||||
class List : public SharedObject
|
||||
{
|
||||
public:
|
||||
typedef SharedPtr <List> Ptr;
|
||||
|
||||
explicit List (SharedObjectArray <Validator>& list)
|
||||
{
|
||||
m_list.swapWith (list);
|
||||
|
||||
Validator::Compare compare;
|
||||
|
||||
m_list.sort (compare);
|
||||
}
|
||||
|
||||
~List ()
|
||||
{
|
||||
}
|
||||
|
||||
/** Retrieve the number of items. */
|
||||
int size () const noexcept
|
||||
{
|
||||
return m_list.size ();
|
||||
}
|
||||
|
||||
/** Retrieve an item by index. */
|
||||
Validator::Ptr operator[] (int index) const
|
||||
{
|
||||
return m_list.getObjectPointer (index);
|
||||
}
|
||||
|
||||
private:
|
||||
SharedObjectArray <Validator> m_list;
|
||||
};
|
||||
|
||||
class ListImp;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
explicit Validator (RipplePublicKey const& publicKey);
|
||||
|
||||
RipplePublicKey const& getPublicKey () const { return m_publicKey; }
|
||||
|
||||
private:
|
||||
RipplePublicKey const m_publicKey;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -357,7 +357,7 @@ public:
|
||||
, m_thread ("Validators")
|
||||
, m_timer (this)
|
||||
{
|
||||
//m_thread.start (this);
|
||||
m_thread.start (this);
|
||||
}
|
||||
|
||||
~ValidatorsImp ()
|
||||
|
||||
Reference in New Issue
Block a user