diff --git a/Builds/VisualStudio2012/RippleD.vcxproj b/Builds/VisualStudio2012/RippleD.vcxproj
index 9c148e7b59..07bb7b27c4 100644
--- a/Builds/VisualStudio2012/RippleD.vcxproj
+++ b/Builds/VisualStudio2012/RippleD.vcxproj
@@ -1694,6 +1694,7 @@
+
@@ -1701,7 +1702,9 @@
+
+
diff --git a/Builds/VisualStudio2012/RippleD.vcxproj.filters b/Builds/VisualStudio2012/RippleD.vcxproj.filters
index e955735d32..28219bdabf 100644
--- a/Builds/VisualStudio2012/RippleD.vcxproj.filters
+++ b/Builds/VisualStudio2012/RippleD.vcxproj.filters
@@ -2184,6 +2184,15 @@
[1] Ripple\peerfinder\api
+
+ [1] Ripple\validators\impl
+
+
+ [1] Ripple\validators\impl
+
+
+ [1] Ripple\validators\impl
+
diff --git a/src/ripple/validators/impl/Ledger.h b/src/ripple/validators/impl/Ledger.h
new file mode 100644
index 0000000000..2609b85d28
--- /dev/null
+++ b/src/ripple/validators/impl/Ledger.h
@@ -0,0 +1,43 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of rippled: https://github.com/ripple/rippled
+ Copyright (c) 2012, 2013 Ripple Labs Inc.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef RIPPLE_VALIDATORS_LEDGER_H_INCLUDED
+#define RIPPLE_VALIDATORS_LEDGER_H_INCLUDED
+
+namespace ripple {
+namespace Validators {
+
+// Stored each time a ledger is closed
+//
+struct Ledger
+{
+ Ledger() : when (RelativeTime::fromStartup())
+ {
+ }
+
+ RelativeTime when;
+};
+
+typedef AgedHistory > LedgerMap;
+
+}
+}
+
+#endif
diff --git a/src/ripple/validators/impl/Logic.h b/src/ripple/validators/impl/Logic.h
index 91a699e0c3..3693f4c177 100644
--- a/src/ripple/validators/impl/Logic.h
+++ b/src/ripple/validators/impl/Logic.h
@@ -23,202 +23,12 @@
namespace ripple {
namespace Validators {
-// Tunable constants
-enum
-{
-#if 0
- // We will fetch a source at this interval
- hoursBetweenFetches = 24
- ,secondsBetweenFetches = hoursBetweenFetches * 60 * 60
- // We check Source expirations on this time interval
- ,checkEverySeconds = 60 * 60
-#else
- secondsBetweenFetches = 59
- ,checkEverySeconds = 60
-#endif
-
- // This tunes the preallocated arrays
- ,expectedNumberOfResults = 1000
-};
-
-//------------------------------------------------------------------------------
-
-enum
-{
- maxSizeBeforeSwap = 100
-};
-
-//------------------------------------------------------------------------------
-
-struct Ledger
-{
- Ledger() : when (Time::getCurrentTime())
- {
- }
-
- Time when;
-};
-
-typedef AgedHistory > Ledgers;
-
-// Information associated with each distinguishable validator
-struct Validator
-{
- Validator ()
- : refCount (0)
- {
- }
-
- void receiveValidation (RippleLedgerHash const& ledgerHash)
- {
- typedef Ledgers::container_type::iterator iterator;
-
- ++count->seen;
-
- // If we already have it in the expected list, close it out
- //
- iterator iter (expected->find (ledgerHash));
- if (iter != expected->end())
- {
- expected->erase (iter);
- expected.back().erase (ledgerHash);
- return;
- }
- else if ((iter = expected.back().find(ledgerHash)) !=
- expected.back().end())
- {
- expected.back().erase (iter);
- return;
- }
-
- // Ledger hasn't closed yet so put it in the received list
- //
- std::pair result (
- received->emplace (ledgerHash, Ledger()));
- bassert (result.second);
- if (received->size() >= maxSizeBeforeSwap)
- swap();
- }
-
- void ledgerClosed (RippleLedgerHash const& ledgerHash)
- {
- typedef Ledgers::container_type::iterator iterator;
-
- ++count->closed;
-
- // If the Validator already gave us the ledger
- // then count it and remove it from both tables.
- //
- iterator iter (received->find (ledgerHash));
- if (iter != received->end())
- {
- received->erase (iter);
- received.back().erase (ledgerHash);
- return;
- }
- else if ((iter = received.back().find (ledgerHash)) !=
- received.back().end())
- {
- received.back().erase (iter);
- return;
- }
-
- // We haven't seen this ledger hash from the
- // validator yet so put it on the expected list
- //
- std::pair result (
- expected->emplace (ledgerHash, Ledger ()));
- bassert (result.second);
- if (expected->size() >= maxSizeBeforeSwap)
- swap();
- }
-
- void swap()
- {
- // Count anything in the old expected list as missing
- count->missing += expected.back().size();
-
- // Count anything in the old received list as orphaned
- count->orphans += received.back().size();
-
- // Rotate and clear
- count.swap();
- expected.swap();
- received.swap();
- count->clear();
- expected->clear();
- received->clear();
- }
-
- struct Count
- {
- Count()
- : closed (0)
- , seen (0)
- , missing (0)
- , orphans (0)
- {
- }
-
- void clear ()
- {
- *this = Count();
- }
-
- // How many ledgers we've seen
- std::size_t closed;
-
- // How many validation's we've seen
- std::size_t seen;
-
- // Estimate of validation's that were missed
- std::size_t missing;
-
- // Estimate of validations not belonging to any ledger
- std::size_t orphans;
- };
-
- int refCount;
-
- AgedHistory count;
- Ledgers received;
- Ledgers expected;
-};
-
-//------------------------------------------------------------------------------
-
// Encapsulates the logic for creating the chosen validators.
// This is a separate class to facilitate the unit tests.
//
class Logic
{
public:
- //--------------------------------------------------------------------------
-
- typedef boost::unordered_map <
- RipplePublicKey, Validator,
- RipplePublicKey::hasher> MapType;
-
- // The master in-memory database of Validator, indexed by all the
- // possible things that we need to care about, and even some that we don't.
- //
- /*
- typedef boost::multi_index_container <
- Validator, boost::multi_index::indexed_by <
-
- boost::multi_index::hashed_unique <
- BOOST_MULTI_INDEX_MEMBER(Logic::Validator,UniqueID,uniqueID)>,
-
- boost::multi_index::hashed_unique <
- BOOST_MULTI_INDEX_MEMBER(Logic::Validator,IPEndpoint,endpoint),
- Connectible::HashAddress>
- >
- > ValidationsMap;
- */
-
- //--------------------------------------------------------------------------
-
struct State
{
State ()
@@ -226,7 +36,7 @@ public:
//sources.reserve (64);
}
- MapType map;
+ ValidatorMap validators;
SourcesType sources;
};
@@ -238,12 +48,6 @@ public:
ChosenList::Ptr m_chosenList;
SharedState m_state;
- // Used to filter duplicate public keys
- //
- typedef AgedHistory > SeenPublicKeys;
- SeenPublicKeys m_seenPublicKeys;
-
// Used to filter duplicate ledger hashes
//
typedef AgedHistory source)
{
- ScopedPointer object (source);
-
if (findSourceByID (source->uniqueID()))
{
m_journal.error << "Duplicate static " << source->name();
@@ -310,7 +112,7 @@ public:
// Add a live source to the list of sources.
//
- void add (Source* source)
+ void add (SharedPtr source)
{
if (findSourceByID (source->uniqueID()))
{
@@ -341,8 +143,8 @@ public:
for (std::size_t i = 0; i < list.size (); ++i)
{
Source::Info const& info (list [i]);
- std::pair result (
- state->map.emplace (info.publicKey, Validator ()));
+ std::pair result (
+ state->validators.emplace (info.publicKey, Validator ()));
Validator& validatorInfo (result.first->second);
++validatorInfo.refCount;
if (result.second)
@@ -366,14 +168,14 @@ public:
for (std::size_t i = 0; i < list.size (); ++i)
{
Source::Info const& info (list [i]);
- MapType::iterator iter (state->map.find (info.publicKey));
- bassert (iter != state->map.end ());
+ ValidatorMap::iterator iter (state->validators.find (info.publicKey));
+ bassert (iter != state->validators.end ());
Validator& validatorInfo (iter->second);
if (--validatorInfo.refCount == 0)
{
// Last reference removed
++numRemoved;
- state->map.erase (iter);
+ state->validators.erase (iter);
dirtyChosen ();
}
}
@@ -390,10 +192,10 @@ public:
void buildChosen ()
{
SharedState::ConstAccess state (m_state);
- ChosenList::Ptr list (new ChosenList (state->map.size ()));
+ ChosenList::Ptr list (new ChosenList (state->validators.size ()));
- for (MapType::const_iterator iter = state->map.begin ();
- iter != state->map.end (); ++iter)
+ for (ValidatorMap::const_iterator iter = state->validators.begin ();
+ iter != state->validators.end (); ++iter)
{
ChosenList::Info info;
list->insert (iter->first, info);
@@ -569,13 +371,13 @@ public:
ChosenList::Ptr list (m_chosenList);
if (list != nullptr)
{
- for (ChosenList::MapType::const_iterator iter (list->map().begin());
+ for (ChosenList::ValidatorMap::const_iterator iter (list->map().begin());
iter != list->map().end(); ++iter)
{
Json::Value entry (Json::objectValue);
- ChosenList::MapType::key_type const& key (iter->first);
+ ChosenList::ValidatorMap::key_type const& key (iter->first);
entry ["key"] = key.to_string();
- //ChosenList::MapType::mapped_type const& value (iter->second);
+ //ChosenList::ValidatorMap::mapped_type const& value (iter->second);
//entry ["value"] = value.to_string();
entries.append (entry);
}
@@ -585,9 +387,9 @@ public:
{
SharedState::ConstAccess state (m_state);
std::size_t count (0);
- result ["validators"] = state->map.size();
- for (MapType::const_iterator iter (state->map.begin());
- iter != state->map.end(); ++iter)
+ result ["validators"] = state->validators.size();
+ for (ValidatorMap::const_iterator iter (state->validators.begin());
+ iter != state->validators.end(); ++iter)
count += iter->second.map.size();
result ["signatures"] = count;
}
@@ -595,9 +397,9 @@ public:
Json::Value entries (Json::arrayValue);
{
SharedState::ConstAccess state (m_state);
- result ["count"] = int(state->map.size());
- for (MapType::const_iterator iter (state->map.begin());
- iter != state->map.end(); ++iter)
+ result ["count"] = int(state->validators.size());
+ for (ValidatorMap::const_iterator iter (state->validators.begin());
+ iter != state->validators.end(); ++iter)
{
Validator const& v (iter->second);
Json::Value entry (Json::objectValue);
@@ -681,6 +483,13 @@ public:
// Called when we receive a signed validation
//
+ // Used to filter duplicate public keys
+ //
+ typedef AgedCache > SeenPublicKeys;
+ SeenPublicKeys m_seenPublicKeys;
+
void receiveValidation (ReceivedValidation const& rv)
{
// Filter duplicates
@@ -697,16 +506,18 @@ public:
}
SharedState::Access state (m_state);
-#if 0
- MapType::iterator iter (state->map.find (rv.publicKey));
- if (iter != state->map.end ())
+#if 1
+ // Accept validation from the trusted list
+ ValidatorMap::iterator iter (state->validators.find (rv.publicKey));
+ if (iter != state->validators.end ())
{
Validator& v (iter->second);
v.receiveValidation (rv.ledgerHash);
}
#else
- std::pair result (
- state->map.emplace (rv.publicKey, Validator()));
+ // Accept any validation (for testing)
+ std::pair result (
+ state->validators.emplace (rv.publicKey, Validator()));
Validator& v (result.first->second);
v.receiveValidation (rv.ledgerHash);
#endif
@@ -730,8 +541,8 @@ public:
}
SharedState::Access state (m_state);
- for (MapType::iterator iter (state->map.begin());
- iter != state->map.end(); ++iter)
+ for (ValidatorMap::iterator iter (state->validators.begin());
+ iter != state->validators.end(); ++iter)
{
Validator& v (iter->second);
v.ledgerClosed (ledgerHash);
diff --git a/src/ripple/validators/impl/Tuning.h b/src/ripple/validators/impl/Tuning.h
new file mode 100644
index 0000000000..78483b7009
--- /dev/null
+++ b/src/ripple/validators/impl/Tuning.h
@@ -0,0 +1,149 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of rippled: https://github.com/ripple/rippled
+ Copyright (c) 2012, 2013 Ripple Labs Inc.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef RIPPLE_VALIDATORS_TUNING_H_INCLUDED
+#define RIPPLE_VALIDATORS_TUNING_H_INCLUDED
+
+namespace ripple {
+namespace Validators {
+
+// Tunable constants
+//
+enum
+{
+#if 0
+ // We will fetch a source at this interval
+ hoursBetweenFetches = 24
+ ,secondsBetweenFetches = hoursBetweenFetches * 60 * 60
+ // We check Source expirations on this time interval
+ ,checkEverySeconds = 60 * 60
+#else
+ secondsBetweenFetches = 59
+ ,checkEverySeconds = 60
+#endif
+
+ // This tunes the preallocated arrays
+ ,expectedNumberOfResults = 1000
+
+ // How many elements in the aged history before we swap containers
+ ,maxSizeBeforeSwap = 100
+};
+
+//------------------------------------------------------------------------------
+
+/** Associative container of unique keys. */
+template
+ class KeyEqual = std::equal_to ,
+ class Allocator = std::allocator > >
+class CycledMap
+{
+private:
+ typedef boost::unordered_map ContainerType;
+
+public:
+ typedef typename ContainerType::key_type key_type;
+ typedef typename ContainerType::value_type value_type;
+ typedef typename ContainerType::size_type size_type;
+ typedef typename ContainerType::difference_type difference_type;
+ typedef typename ContainerType::hasher hasher;
+ typedef typename ContainerType::allocator_type allocator_type;
+ typedef typename ContainerType::reference reference;
+ typedef typename ContainerType::const_reference const_reference;
+ typedef typename ContainerType::pointer pointer;
+ typedef typename ContainerType::const_pointer const_pointer;
+
+ void cycle ()
+ {
+ m_front.clear ();
+ std::swap (m_front, m_back);
+ }
+
+private:
+ ContainerType m_front;
+ ContainerType m_back;
+};
+
+//------------------------------------------------------------------------------
+
+/** Associative container of unique keys. */
+template
+ class KeyEqual = std::equal_to ,
+ class Allocator = std::allocator >
+class CycledSet
+{
+private:
+ typedef boost::unordered_set ContainerType;
+
+public:
+ typedef typename ContainerType::key_type key_type;
+ typedef typename ContainerType::value_type value_type;
+ typedef typename ContainerType::size_type size_type;
+ typedef typename ContainerType::difference_type difference_type;
+ typedef typename ContainerType::hasher hasher;
+ typedef typename ContainerType::key_equal key_equal;
+ typedef typename ContainerType::allocator_type allocator_type;
+ typedef typename ContainerType::reference reference;
+ typedef typename ContainerType::const_reference const_reference;
+ typedef typename ContainerType::pointer pointer;
+ typedef typename ContainerType::const_pointer const_pointer;
+
+ explicit CycledSet (
+ size_type item_max,
+ Hash hash = Hash(),
+ KeyEqual equal = KeyEqual(),
+ Allocator alloc = Allocator())
+ : m_max (item_max)
+ , m_hash (hash)
+ , m_equal (equal)
+ , m_alloc (alloc)
+ , m_front (hash, equal, alloc)
+ , m_back (hash, equal, alloc)
+ {
+ m_front.reserve (m_max);
+ m_back.reserve (m_max);
+ }
+
+ void cycle ()
+ {
+ m_front.clear ();
+ std::swap (m_front, m_back);
+ }
+
+ bool insert (value_type const& value)
+ {
+ std::size_t const hash (m_hash (value));
+
+ }
+
+private:
+ size_type m_max;
+ hasher m_hash;
+ key_equal m_equal;
+ allocator_type m_alloc;
+ ContainerType m_front;
+ ContainerType m_back;
+};
+
+}
+}
+
+#endif
diff --git a/src/ripple/validators/impl/Utilities.cpp b/src/ripple/validators/impl/Utilities.cpp
index ef3f85155f..25e128d5ae 100644
--- a/src/ripple/validators/impl/Utilities.cpp
+++ b/src/ripple/validators/impl/Utilities.cpp
@@ -88,14 +88,14 @@ bool Utilities::parseInfoLine (
std::string const encodedKey (match [1]);
std::string const commentText (match [2]);
- RippleAddress deprecatedPublicKey;
+ std::pair result (
+ RipplePublicKey::from_string (encodedKey));
- if (deprecatedPublicKey.setNodePublic (encodedKey))
+ if (result.second)
{
// We got a public key.
- RipplePublicKey publicKey (deprecatedPublicKey);
info.label = commentText;
- info.publicKey = publicKey;
+ info.publicKey = result.first;
success = true;
}
else
diff --git a/src/ripple/validators/impl/Validator.h b/src/ripple/validators/impl/Validator.h
new file mode 100644
index 0000000000..2b77cf3426
--- /dev/null
+++ b/src/ripple/validators/impl/Validator.h
@@ -0,0 +1,178 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of rippled: https://github.com/ripple/rippled
+ Copyright (c) 2012, 2013 Ripple Labs Inc.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef RIPPLE_VALIDATORS_VALIDATOR_H_INCLUDED
+#define RIPPLE_VALIDATORS_VALIDATOR_H_INCLUDED
+
+namespace ripple {
+namespace Validators {
+
+// Stored for each distinguishable Validator in the trusted list.
+// These are kept in an associative container or multi-index container.
+//
+class Validator
+{
+public:
+ Validator () : refCount (0)
+ {
+ }
+
+ void receiveValidation (RippleLedgerHash const& ledgerHash)
+ {
+ typedef LedgerMap::container_type::iterator iterator;
+
+ ++count->seen;
+
+ // If we already have it in the expected list, close it out
+ //
+ iterator iter (expected->find (ledgerHash));
+ if (iter != expected->end())
+ {
+ expected->erase (iter);
+ expected.back().erase (ledgerHash);
+ return;
+ }
+ else if ((iter = expected.back().find(ledgerHash)) !=
+ expected.back().end())
+ {
+ expected.back().erase (iter);
+ return;
+ }
+
+ // Ledger hasn't closed yet so put it in the received list
+ //
+ std::pair result (
+ received->emplace (ledgerHash, Ledger()));
+ bassert (result.second);
+ if (received->size() >= maxSizeBeforeSwap)
+ swap();
+ }
+
+ void ledgerClosed (RippleLedgerHash const& ledgerHash)
+ {
+ typedef LedgerMap::container_type::iterator iterator;
+
+ ++count->closed;
+
+ // If the Validator already gave us the ledger
+ // then count it and remove it from both tables.
+ //
+ iterator iter (received->find (ledgerHash));
+ if (iter != received->end())
+ {
+ received->erase (iter);
+ received.back().erase (ledgerHash);
+ return;
+ }
+ else if ((iter = received.back().find (ledgerHash)) !=
+ received.back().end())
+ {
+ received.back().erase (iter);
+ return;
+ }
+
+ // We haven't seen this ledger hash from the
+ // validator yet so put it on the expected list
+ //
+ std::pair result (
+ expected->emplace (ledgerHash, Ledger ()));
+ bassert (result.second);
+ if (expected->size() >= maxSizeBeforeSwap)
+ swap();
+ }
+
+ void swap()
+ {
+ // Count anything in the old expected list as missing
+ count->missing += expected.back().size();
+
+ // Count anything in the old received list as orphaned
+ count->orphans += received.back().size();
+
+ // Rotate and clear
+ count.swap();
+ expected.swap();
+ received.swap();
+ count->clear();
+ expected->clear();
+ received->clear();
+ }
+
+ struct Count
+ {
+ Count()
+ : closed (0)
+ , seen (0)
+ , missing (0)
+ , orphans (0)
+ {
+ }
+
+ void clear ()
+ {
+ *this = Count();
+ }
+
+ // How many LedgerMap we've seen
+ std::size_t closed;
+
+ // How many validation's we've seen
+ std::size_t seen;
+
+ // Estimate of validation's that were missed
+ std::size_t missing;
+
+ // Estimate of validations not belonging to any ledger
+ std::size_t orphans;
+ };
+
+ int refCount;
+
+ AgedHistory count;
+ LedgerMap received;
+ LedgerMap expected;
+};
+
+//------------------------------------------------------------------------------
+
+typedef boost::unordered_map <
+ RipplePublicKey, Validator,
+ RipplePublicKey::hasher> ValidatorMap;
+
+// The master in-memory database of Validator, indexed by all the
+// possible things that we need to care about, and even some that we don't.
+//
+/*
+typedef boost::multi_index_container <
+ Validator, boost::multi_index::indexed_by <
+
+ boost::multi_index::hashed_unique <
+ BOOST_MULTI_INDEX_MEMBER(Logic::Validator,UniqueID,uniqueID)>,
+
+ boost::multi_index::hashed_unique <
+ BOOST_MULTI_INDEX_MEMBER(Logic::Validator,IPEndpoint,endpoint),
+ Connectible::HashAddress>
+ >
+> ValidationsMap;
+*/
+
+}
+}
+
+#endif
diff --git a/src/ripple/validators/ripple_validators.cpp b/src/ripple/validators/ripple_validators.cpp
index b0434240eb..c286505bfb 100644
--- a/src/ripple/validators/ripple_validators.cpp
+++ b/src/ripple/validators/ripple_validators.cpp
@@ -23,6 +23,7 @@
#include "beast/modules/beast_core/system/BeforeBoost.h"
#include
+#include
#include
#include
#include
@@ -33,14 +34,13 @@
#include "beast/modules/beast_asio/beast_asio.h"
#include "beast/modules/beast_sqdb/beast_sqdb.h"
-#include "../ripple_data/ripple_data.h" // for RippleAddress REMOVE ASAP
-
#include "../testoverlay/ripple_testoverlay.h" // for unit test
namespace ripple {
using namespace beast;
}
+# include "impl/Tuning.h"
# include "impl/ChosenList.h"
# include "impl/SourceFile.h"
# include "impl/SourceStrings.h"
@@ -49,6 +49,8 @@ using namespace beast;
# include "impl/SourceDesc.h"
# include "impl/Store.h"
# include "impl/StoreSqdb.h"
+# include "impl/Ledger.h"
+# include "impl/Validator.h"
#include "impl/Logic.h"
#include "impl/Manager.cpp"
diff --git a/src/ripple_app/main/Application.cpp b/src/ripple_app/main/Application.cpp
index 837ec77f97..1d0bbcd82f 100644
--- a/src/ripple_app/main/Application.cpp
+++ b/src/ripple_app/main/Application.cpp
@@ -117,9 +117,8 @@ public:
, m_txQueue (TxQueue::New ())
- , m_validators (m_rpcServiceManager->add (
- Validators::Manager::New (*this, LogJournal::get ())
- ))
+ , m_validators (Validators::Manager::New (
+ *this, LogJournal::get ()))
, mFeatures (IFeatures::New (2 * 7 * 24 * 60 * 60, 200)) // two weeks, 200/256
@@ -643,6 +642,8 @@ public:
void onPrepare ()
{
+ m_rpcServiceManager->add (*m_validators);
+
prepareValidators ();
}