From bd7eb94d694c13ae60648bdab81340e5fd7b61fd Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Jun 2015 06:39:31 -0700 Subject: [PATCH] Refactor clock declarations in chrono.h --- Builds/VisualStudio2013/RippleD.vcxproj | 4 +- .../VisualStudio2013/RippleD.vcxproj.filters | 6 +- src/ripple/app/ledger/AcceptedLedger.cpp | 4 +- src/ripple/app/ledger/LedgerHistory.cpp | 6 +- src/ripple/app/ledger/tests/common_ledger.h | 2 +- src/ripple/app/main/Application.cpp | 20 ++-- src/ripple/app/misc/Validations.cpp | 4 +- .../app/misc/tests/AmendmentTable.test.cpp | 2 +- src/ripple/app/tx/impl/TransactionMaster.cpp | 4 +- src/ripple/app/tx/tests/common_transactor.cpp | 2 +- src/ripple/basics/chrono.h | 96 +++++++++++++++++++ src/ripple/basics/impl/make_SSLContext.cpp | 4 +- src/ripple/basics/seconds_clock.h | 47 --------- src/ripple/basics/tests/KeyCache.test.cpp | 3 +- src/ripple/basics/tests/TaggedCache.test.cpp | 3 +- src/ripple/nodestore/impl/DatabaseImp.h | 6 +- src/ripple/overlay/impl/OverlayImpl.cpp | 2 +- src/ripple/overlay/impl/OverlayImpl.h | 2 +- src/ripple/peerfinder/sim/Tests.cpp | 2 +- .../peerfinder/tests/Livecache.test.cpp | 3 +- .../peerfinder/tests/PeerFinder_test.cpp | 6 +- src/ripple/resource/impl/Manager.cpp | 4 +- src/ripple/resource/tests/Logic.test.cpp | 11 +-- src/ripple/server/impl/ServerImpl.h | 2 +- src/ripple/shamap/impl/SHAMap.cpp | 1 - src/ripple/shamap/tests/common.h | 4 +- src/ripple/validators/impl/Logic.cpp | 2 +- src/ripple/validators/impl/Logic.h | 6 +- src/ripple/validators/impl/Manager.cpp | 2 +- 29 files changed, 153 insertions(+), 107 deletions(-) create mode 100644 src/ripple/basics/chrono.h delete mode 100644 src/ripple/basics/seconds_clock.h diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index 455088311a..50a246e641 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj +++ b/Builds/VisualStudio2013/RippleD.vcxproj @@ -1897,6 +1897,8 @@ + + @@ -1981,8 +1983,6 @@ - - diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters index 925fd56ed8..b338d4e32c 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters @@ -2637,6 +2637,9 @@ ripple\basics + + ripple\basics + ripple\basics @@ -2718,9 +2721,6 @@ ripple\basics - - ripple\basics - ripple\basics diff --git a/src/ripple/app/ledger/AcceptedLedger.cpp b/src/ripple/app/ledger/AcceptedLedger.cpp index 9c6027eaac..170788032a 100644 --- a/src/ripple/app/ledger/AcceptedLedger.cpp +++ b/src/ripple/app/ledger/AcceptedLedger.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace ripple { @@ -28,7 +28,7 @@ namespace ripple { // Use a dependency injection to give AcceptedLedger access. // TaggedCache AcceptedLedger::s_cache ( - "AcceptedLedger", 4, 60, get_seconds_clock (), + "AcceptedLedger", 4, 60, stopwatch(), deprecatedLogs().journal("TaggedCache")); AcceptedLedger::AcceptedLedger (Ledger::ref ledger) : mLedger (ledger) diff --git a/src/ripple/app/ledger/LedgerHistory.cpp b/src/ripple/app/ledger/LedgerHistory.cpp index c600a900c6..82d04c0d8b 100644 --- a/src/ripple/app/ledger/LedgerHistory.cpp +++ b/src/ripple/app/ledger/LedgerHistory.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace ripple { @@ -42,9 +42,9 @@ LedgerHistory::LedgerHistory ( : collector_ (collector) , mismatch_counter_ (collector->make_counter ("ledger.history", "mismatch")) , m_ledgers_by_hash ("LedgerCache", CACHED_LEDGER_NUM, CACHED_LEDGER_AGE, - get_seconds_clock (), deprecatedLogs().journal("TaggedCache")) + stopwatch(), deprecatedLogs().journal("TaggedCache")) , m_consensus_validated ("ConsensusValidated", 64, 300, - get_seconds_clock (), deprecatedLogs().journal("TaggedCache")) + stopwatch(), deprecatedLogs().journal("TaggedCache")) { } diff --git a/src/ripple/app/ledger/tests/common_ledger.h b/src/ripple/app/ledger/tests/common_ledger.h index 9e0f99cfc1..2b68699361 100644 --- a/src/ripple/app/ledger/tests/common_ledger.h +++ b/src/ripple/app/ledger/tests/common_ledger.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index d42f18a615..f87c93c9ac 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -121,9 +121,9 @@ public: AppFamily (NodeStore::Database& db, CollectorManager& collectorManager) - : treecache_ ("TreeNodeCache", 65536, 60, get_seconds_clock(), + : treecache_ ("TreeNodeCache", 65536, 60, stopwatch(), deprecatedLogs().journal("TaggedCache")) - , fullbelow_ ("full_below", get_seconds_clock(), + , fullbelow_ ("full_below", stopwatch(), collectorManager.collector(), fullBelowTargetSize, fullBelowExpirationSeconds) , db_ (db) @@ -338,7 +338,7 @@ public: , accountIDCache_(128000) - , m_tempNodeCache ("NodeCache", 16384, 90, get_seconds_clock (), + , m_tempNodeCache ("NodeCache", 16384, 90, stopwatch(), m_logs.journal("TaggedCache")) , m_collectorManager (CollectorManager::New ( @@ -346,7 +346,7 @@ public: , family_ (*m_nodeStore, *m_collectorManager) - , m_sleCache ("LedgerEntryCache", 4096, 120, get_seconds_clock (), + , m_sleCache ("LedgerEntryCache", 4096, 120, stopwatch(), m_logs.journal("TaggedCache")) , m_resourceManager (Resource::make_Manager ( @@ -375,11 +375,11 @@ public: // VFALCO NOTE must come before NetworkOPs to prevent a crash due // to dependencies in the destructor. // - , m_inboundLedgers (make_InboundLedgers (get_seconds_clock (), + , m_inboundLedgers (make_InboundLedgers (stopwatch(), *m_jobQueue, m_collectorManager->collector ())) , m_inboundTransactions (make_InboundTransactions - ( get_seconds_clock () + ( stopwatch() , *m_jobQueue , m_collectorManager->collector () , [this](uint256 const& setHash, @@ -388,7 +388,7 @@ public: gotTXSet (setHash, set); })) - , m_networkOPs (make_NetworkOPs (get_seconds_clock (), + , m_networkOPs (make_NetworkOPs (stopwatch(), getConfig ().RUN_STANDALONE, getConfig ().NETWORK_QUORUM, *m_jobQueue, *m_ledgerMaster, *m_jobQueue, m_logs.journal("NetworkOPs"))) @@ -1239,7 +1239,7 @@ bool ApplicationImp::loadOldLedger ( { // Try to build the ledger from the back end auto il = std::make_shared (hash, 0, InboundLedger::fcGENERIC, - get_seconds_clock ()); + stopwatch()); if (il->checkLocal ()) loadLedger = il->getLedger (); } @@ -1273,7 +1273,7 @@ bool ApplicationImp::loadOldLedger ( // Try to build the ledger from the back end auto il = std::make_shared ( replayLedger->getParentHash(), 0, InboundLedger::fcGENERIC, - get_seconds_clock ()); + stopwatch()); if (il->checkLocal ()) loadLedger = il->getLedger (); diff --git a/src/ripple/app/misc/Validations.cpp b/src/ripple/app/misc/Validations.cpp index 01c80c1e35..03358098a2 100644 --- a/src/ripple/app/misc/Validations.cpp +++ b/src/ripple/app/misc/Validations.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include // #include @@ -70,7 +70,7 @@ private: public: ValidationsImp () - : mValidations ("Validations", 128, 600, get_seconds_clock (), + : mValidations ("Validations", 128, 600, stopwatch(), deprecatedLogs().journal("TaggedCache")) , mWriting (false) { diff --git a/src/ripple/app/misc/tests/AmendmentTable.test.cpp b/src/ripple/app/misc/tests/AmendmentTable.test.cpp index 68da0d2c34..4d44d4ba49 100644 --- a/src/ripple/app/misc/tests/AmendmentTable.test.cpp +++ b/src/ripple/app/misc/tests/AmendmentTable.test.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/src/ripple/app/tx/impl/TransactionMaster.cpp b/src/ripple/app/tx/impl/TransactionMaster.cpp index d47ef3e2e8..f485c339f0 100644 --- a/src/ripple/app/tx/impl/TransactionMaster.cpp +++ b/src/ripple/app/tx/impl/TransactionMaster.cpp @@ -21,12 +21,12 @@ #include #include #include -#include +#include namespace ripple { TransactionMaster::TransactionMaster () - : mCache ("TransactionCache", 65536, 1800, get_seconds_clock (), + : mCache ("TransactionCache", 65536, 1800, stopwatch(), deprecatedLogs().journal("TaggedCache")) { } diff --git a/src/ripple/app/tx/tests/common_transactor.cpp b/src/ripple/app/tx/tests/common_transactor.cpp index c5cacaeeac..4879394ec3 100644 --- a/src/ripple/app/tx/tests/common_transactor.cpp +++ b/src/ripple/app/tx/tests/common_transactor.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/ripple/basics/chrono.h b/src/ripple/basics/chrono.h new file mode 100644 index 0000000000..b298ac3f8c --- /dev/null +++ b/src/ripple/basics/chrono.h @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------ +/* + 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_BASICS_CHRONO_H_INCLUDED +#define RIPPLE_BASICS_CHRONO_H_INCLUDED + +#include +#include +#include +#include +#include + +namespace ripple { + +// A few handy aliases + +using days = std::chrono::duration + >>; + +using weeks = std::chrono::duration + >>; + +/** A clock for measuring elapsed time. + + The epoch is unspecified. +*/ +using Stopwatch = + beast::abstract_clock< + std::chrono::steady_clock>; + +/** A manual clock for unit tests. */ +using TestClock = + beast::manual_clock< + Stopwatch::clock_type>; + +/** Clock for measuring Ripple Network Time. + + The epoch is January 1, 2000 +*/ +// VFALCO TODO Finish the implementation and make +// the network clock instance a member +// of the Application object +// +// epoch_offset = days(10957); // 2000-01-01 +// +class NetClock // : public abstract_clock +{ +public: + // Unfortunately this is signed for legacy reasons + using rep = std::int32_t; + + using period = std::ratio<1>; + + using duration = + std::chrono::duration; + + using time_point = + std::chrono::time_point< + NetClock, duration>; + + // VFALCO now() intentionally omitted for the moment +}; + +/** Returns an instance of a wall clock. */ +inline +Stopwatch& +stopwatch() +{ + return beast::get_abstract_clock< + std::chrono::steady_clock, + beast::basic_seconds_clock< + std::chrono::steady_clock>>(); +} + +} // ripple + +#endif diff --git a/src/ripple/basics/impl/make_SSLContext.cpp b/src/ripple/basics/impl/make_SSLContext.cpp index d3abcf7e6b..5595c22deb 100644 --- a/src/ripple/basics/impl/make_SSLContext.cpp +++ b/src/ripple/basics/impl/make_SSLContext.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -175,7 +175,7 @@ struct StaticData beast::aged_unordered_set set; StaticData() - : set (ripple::get_seconds_clock ()) + : set (ripple::stopwatch()) { } }; diff --git a/src/ripple/basics/seconds_clock.h b/src/ripple/basics/seconds_clock.h deleted file mode 100644 index b230c17658..0000000000 --- a/src/ripple/basics/seconds_clock.h +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -/* - 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_BASICS_SECONDS_CLOCK_H_INCLUDED -#define RIPPLE_BASICS_SECONDS_CLOCK_H_INCLUDED - -#include -#include - -#include - -namespace ripple { - -using days = std::chrono::duration - >>; - -using weeks = std::chrono::duration - >>; - -/** Returns an abstract_clock optimized for counting seconds. */ -inline -beast::abstract_clock& -get_seconds_clock() -{ - return beast::get_abstract_clock>(); -} - -} - -#endif diff --git a/src/ripple/basics/tests/KeyCache.test.cpp b/src/ripple/basics/tests/KeyCache.test.cpp index 27e23ec92c..8e86c6f8a4 100644 --- a/src/ripple/basics/tests/KeyCache.test.cpp +++ b/src/ripple/basics/tests/KeyCache.test.cpp @@ -18,6 +18,7 @@ //============================================================================== #include +#include #include #include #include @@ -29,7 +30,7 @@ class KeyCache_test : public beast::unit_test::suite public: void run () { - beast::manual_clock clock; + TestClock clock; clock.set (0); using Key = std::string; diff --git a/src/ripple/basics/tests/TaggedCache.test.cpp b/src/ripple/basics/tests/TaggedCache.test.cpp index e911c8dd47..05dd614710 100644 --- a/src/ripple/basics/tests/TaggedCache.test.cpp +++ b/src/ripple/basics/tests/TaggedCache.test.cpp @@ -18,6 +18,7 @@ //============================================================================== #include +#include #include #include #include @@ -41,7 +42,7 @@ public: { beast::Journal const j; - beast::manual_clock clock; + TestClock clock; clock.set (0); using Key = int; diff --git a/src/ripple/nodestore/impl/DatabaseImp.h b/src/ripple/nodestore/impl/DatabaseImp.h index 1653c05ed0..dfa4486789 100644 --- a/src/ripple/nodestore/impl/DatabaseImp.h +++ b/src/ripple/nodestore/impl/DatabaseImp.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -72,8 +72,8 @@ public: , m_scheduler (scheduler) , m_backend (std::move (backend)) , m_cache ("NodeStore", cacheTargetSize, cacheTargetSeconds, - get_seconds_clock (), deprecatedLogs().journal("TaggedCache")) - , m_negCache ("NodeStore", get_seconds_clock (), + stopwatch(), deprecatedLogs().journal("TaggedCache")) + , m_negCache ("NodeStore", stopwatch(), cacheTargetSize, cacheTargetSeconds) , m_readShut (false) , m_readGen (0) diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index 38cfdfccf3..cfc81ab961 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -139,7 +139,7 @@ OverlayImpl::OverlayImpl ( , serverHandler_(serverHandler) , m_resourceManager (resourceManager) , m_peerFinder (PeerFinder::make_Manager (*this, io_service, - get_seconds_clock(), deprecatedLogs().journal("PeerFinder"), config)) + stopwatch(), deprecatedLogs().journal("PeerFinder"), config)) , m_resolver (resolver) , next_id_(1) , timer_count_(0) diff --git a/src/ripple/overlay/impl/OverlayImpl.h b/src/ripple/overlay/impl/OverlayImpl.h index c2a1e5d5a7..7c01c71da7 100644 --- a/src/ripple/overlay/impl/OverlayImpl.h +++ b/src/ripple/overlay/impl/OverlayImpl.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/ripple/peerfinder/sim/Tests.cpp b/src/ripple/peerfinder/sim/Tests.cpp index e6de29320f..24a9645b88 100644 --- a/src/ripple/peerfinder/sim/Tests.cpp +++ b/src/ripple/peerfinder/sim/Tests.cpp @@ -65,7 +65,7 @@ private: Params m_params; Journal m_journal; int m_next_node_id; - manual_clock m_clock; + TestClock m_clock; Peers m_nodes; Table m_table; FunctionQueue m_queue; diff --git a/src/ripple/peerfinder/tests/Livecache.test.cpp b/src/ripple/peerfinder/tests/Livecache.test.cpp index 06849c468f..9ebda4788a 100644 --- a/src/ripple/peerfinder/tests/Livecache.test.cpp +++ b/src/ripple/peerfinder/tests/Livecache.test.cpp @@ -18,6 +18,7 @@ //============================================================================== #include +#include #include #include #include @@ -28,7 +29,7 @@ namespace PeerFinder { class Livecache_test : public beast::unit_test::suite { public: - beast::manual_clock m_clock; + TestClock m_clock; // Add the address as an endpoint template diff --git a/src/ripple/peerfinder/tests/PeerFinder_test.cpp b/src/ripple/peerfinder/tests/PeerFinder_test.cpp index 7ef7372a78..d149113307 100644 --- a/src/ripple/peerfinder/tests/PeerFinder_test.cpp +++ b/src/ripple/peerfinder/tests/PeerFinder_test.cpp @@ -18,9 +18,9 @@ //============================================================================== #include +#include #include #include -#include namespace ripple { namespace PeerFinder { @@ -71,7 +71,7 @@ public: testcase("backoff 1"); TestStore store; TestChecker checker; - beast::manual_clock clock; + TestClock clock; Logic logic (clock, store, checker, beast::Journal{}); logic.addFixedPeer ("test", beast::IP::Endpoint::from_string("65.0.0.1:5")); @@ -109,7 +109,7 @@ public: testcase("backoff 2"); TestStore store; TestChecker checker; - beast::manual_clock clock; + TestClock clock; Logic logic (clock, store, checker, beast::Journal{}); logic.addFixedPeer ("test", beast::IP::Endpoint::from_string("65.0.0.1:5")); diff --git a/src/ripple/resource/impl/Manager.cpp b/src/ripple/resource/impl/Manager.cpp index c8f9dc9df5..a62d3946ce 100644 --- a/src/ripple/resource/impl/Manager.cpp +++ b/src/ripple/resource/impl/Manager.cpp @@ -18,7 +18,7 @@ //============================================================================== #include -#include +#include #include #include #include // @@ -38,7 +38,7 @@ public: beast::Journal journal) : Thread ("Resource::Manager") , m_journal (journal) - , m_logic (collector, get_seconds_clock (), journal) + , m_logic (collector, stopwatch(), journal) { startThread (); } diff --git a/src/ripple/resource/tests/Logic.test.cpp b/src/ripple/resource/tests/Logic.test.cpp index ecc3d82523..bd07b6f2be 100644 --- a/src/ripple/resource/tests/Logic.test.cpp +++ b/src/ripple/resource/tests/Logic.test.cpp @@ -18,9 +18,9 @@ //============================================================================== #include +#include #include #include -#include #include #include @@ -31,14 +31,13 @@ class Manager_test : public beast::unit_test::suite { public: class TestLogic - : private boost::base_from_member < - beast::manual_clock > + : private boost::base_from_member , public Logic { private: - using clock_type = boost::base_from_member < - beast::manual_clock >; + using clock_type = + boost::base_from_member; public: explicit TestLogic (beast::Journal journal) @@ -51,7 +50,7 @@ public: ++member; } - beast::manual_clock & clock () + TestClock& clock () { return member; } diff --git a/src/ripple/server/impl/ServerImpl.h b/src/ripple/server/impl/ServerImpl.h index 1b7cb2b1cb..8b4f3fc878 100644 --- a/src/ripple/server/impl/ServerImpl.h +++ b/src/ripple/server/impl/ServerImpl.h @@ -20,7 +20,7 @@ #ifndef RIPPLE_SERVER_SERVERIMPL_H_INCLUDED #define RIPPLE_SERVER_SERVERIMPL_H_INCLUDED -#include +#include #include #include #include diff --git a/src/ripple/shamap/impl/SHAMap.cpp b/src/ripple/shamap/impl/SHAMap.cpp index 11b7885f0b..a8e17e1199 100644 --- a/src/ripple/shamap/impl/SHAMap.cpp +++ b/src/ripple/shamap/impl/SHAMap.cpp @@ -20,7 +20,6 @@ #include #include #include -#include namespace ripple { diff --git a/src/ripple/shamap/tests/common.h b/src/ripple/shamap/tests/common.h index 0298aaa5fe..8932706a17 100644 --- a/src/ripple/shamap/tests/common.h +++ b/src/ripple/shamap/tests/common.h @@ -21,6 +21,7 @@ #define RIPPLE_SHAMAP_TESTS_COMMON_H_INCLUDED #include +#include #include #include #include @@ -38,8 +39,7 @@ namespace tests { class TestFamily : public shamap::Family { private: - beast::manual_clock < - std::chrono::steady_clock> clock_; + TestClock clock_; NodeStore::DummyScheduler scheduler_; TreeNodeCache treecache_; FullBelowCache fullbelow_; diff --git a/src/ripple/validators/impl/Logic.cpp b/src/ripple/validators/impl/Logic.cpp index 1e558ec9cf..220e6ac4a5 100644 --- a/src/ripple/validators/impl/Logic.cpp +++ b/src/ripple/validators/impl/Logic.cpp @@ -62,7 +62,7 @@ namespace Validators { Logic::Logic (Store& store, beast::Journal journal) : /*store_ (store) , */journal_ (journal) - , ledgers_(get_seconds_clock()) + , ledgers_(stopwatch()) { } diff --git a/src/ripple/validators/impl/Logic.h b/src/ripple/validators/impl/Logic.h index 47caa436c5..22a087525d 100644 --- a/src/ripple/validators/impl/Logic.h +++ b/src/ripple/validators/impl/Logic.h @@ -22,11 +22,10 @@ #include #include -#include +#include #include #include #include -#include #include #include #include @@ -43,9 +42,6 @@ class ConnectionImp; class Logic { -public: - using clock_type = beast::abstract_clock; - private: struct LedgerMeta { diff --git a/src/ripple/validators/impl/Manager.cpp b/src/ripple/validators/impl/Manager.cpp index 4b854db965..06a18a2d0a 100644 --- a/src/ripple/validators/impl/Manager.cpp +++ b/src/ripple/validators/impl/Manager.cpp @@ -237,7 +237,7 @@ public: newConnection (int id) override { return std::make_unique( - id, logic_, get_seconds_clock()); + id, logic_, stopwatch()); } void