diff --git a/Builds/VisualStudio2012/RippleD.vcxproj b/Builds/VisualStudio2012/RippleD.vcxproj index a553ceb50..d911a3ffc 100644 --- a/Builds/VisualStudio2012/RippleD.vcxproj +++ b/Builds/VisualStudio2012/RippleD.vcxproj @@ -796,12 +796,6 @@ true true - - true - true - true - true - true true @@ -1519,7 +1513,6 @@ - diff --git a/Builds/VisualStudio2012/RippleD.vcxproj.filters b/Builds/VisualStudio2012/RippleD.vcxproj.filters index c9578065f..b3ed72bf8 100644 --- a/Builds/VisualStudio2012/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2012/RippleD.vcxproj.filters @@ -861,9 +861,6 @@ [1] Ripple\ripple_core\validator - - [1] Ripple\ripple_core\validator - [1] Ripple\ripple_core\validator @@ -1682,9 +1679,6 @@ [1] Ripple\ripple_core\validator - - [1] Ripple\ripple_core\validator - [1] Ripple\ripple_core\validator diff --git a/modules/ripple_core/ripple_core.cpp b/modules/ripple_core/ripple_core.cpp index 3299d9d62..0ce5b7668 100644 --- a/modules/ripple_core/ripple_core.cpp +++ b/modules/ripple_core/ripple_core.cpp @@ -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 diff --git a/modules/ripple_core/validator/Validator.cpp b/modules/ripple_core/validator/Validator.cpp deleted file mode 100644 index 2a3913a27..000000000 --- a/modules/ripple_core/validator/Validator.cpp +++ /dev/null @@ -1,10 +0,0 @@ -//------------------------------------------------------------------------------ -/* - Copyright (c) 2011-2013, OpenCoin, Inc. -*/ -//============================================================================== - -Validator::Validator (RipplePublicKey const& publicKey) - : m_publicKey (publicKey) -{ -} diff --git a/modules/ripple_core/validator/Validator.h b/modules/ripple_core/validator/Validator.h deleted file mode 100644 index cd7f4411b..000000000 --- a/modules/ripple_core/validator/Validator.h +++ /dev/null @@ -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 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 & arrayToSort) - { - Array 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 Ptr; - - explicit List (SharedObjectArray & 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 m_list; - }; - - class ListImp; - - //-------------------------------------------------------------------------- - - explicit Validator (RipplePublicKey const& publicKey); - - RipplePublicKey const& getPublicKey () const { return m_publicKey; } - -private: - RipplePublicKey const m_publicKey; - -}; - -#endif diff --git a/modules/ripple_core/validator/ValidatorsImp.h b/modules/ripple_core/validator/ValidatorsImp.h index 5ff6466cb..1ed15b430 100644 --- a/modules/ripple_core/validator/ValidatorsImp.h +++ b/modules/ripple_core/validator/ValidatorsImp.h @@ -357,7 +357,7 @@ public: , m_thread ("Validators") , m_timer (this) { - //m_thread.start (this); + m_thread.start (this); } ~ValidatorsImp ()