From 58547f69979b242fc188dbe68691b89fb2f865f8 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 28 Jul 2014 09:01:32 -0700 Subject: [PATCH] Tidy up hardened containers (RIPD-380): * Rename hardened containers for clarity * Fixes https://ripplelabs.atlassian.net/browse/RIPD-380 --- .../basics/containers/SyncUnorderedMap.h | 2 +- src/ripple/basics/log/Log.h | 3 +- src/ripple/common/KeyCache.h | 5 +- src/ripple/common/TaggedCache.h | 5 +- src/ripple/common/UnorderedContainers.h | 50 ++++++++++++++++++- src/ripple/module/app/consensus/DisputedTx.h | 2 +- .../module/app/consensus/LedgerConsensus.cpp | 17 +++---- src/ripple/module/app/ledger/BookListeners.h | 2 +- .../module/app/ledger/InboundLedgers.cpp | 10 ++-- src/ripple/module/app/ledger/LedgerEntrySet.h | 2 +- src/ripple/module/app/ledger/LedgerMaster.cpp | 2 +- src/ripple/module/app/ledger/OrderBookDB.cpp | 8 +-- src/ripple/module/app/ledger/OrderBookDB.h | 6 +-- src/ripple/module/app/misc/AmendmentTable.h | 2 +- .../module/app/misc/AmendmentTableImpl.cpp | 4 +- src/ripple/module/app/misc/HashRouter.cpp | 4 +- src/ripple/module/app/misc/NetworkOPs.cpp | 17 +++---- src/ripple/module/app/misc/NetworkOPs.h | 5 +- src/ripple/module/app/misc/Validations.h | 4 +- src/ripple/module/app/paths/Calculators.h | 2 +- src/ripple/module/app/paths/Pathfinder.h | 2 +- src/ripple/module/app/paths/RippleLineCache.h | 2 +- src/ripple/module/app/paths/Types.h | 2 +- src/ripple/module/app/peers/PeerSet.h | 2 +- .../module/app/peers/UniqueNodeList.cpp | 12 ++--- .../module/app/shamap/FetchPackTests.cpp | 2 +- src/ripple/module/app/shamap/SHAMap.cpp | 7 ++- src/ripple/module/app/shamap/SHAMap.h | 7 ++- .../app/transactors/CreateOfferBridged.h | 2 - .../app/transactors/CreateOfferDirect.h | 2 - .../module/app/websocket/WSServerHandler.h | 15 +++--- .../module/core/functional/JobQueue.cpp | 2 +- .../module/data/protocol/RippleAddress.cpp | 2 +- src/ripple/module/net/rpc/InfoSub.h | 17 +++---- .../module/rpc/handlers/Unsubscribe.cpp | 4 +- src/ripple/module/rpc/impl/ErrorCodes.cpp | 3 +- src/ripple/module/rpc/impl/Manager.cpp | 2 +- .../module/rpc/impl/ParseAccountIds.cpp | 4 +- src/ripple/module/rpc/impl/ParseAccountIds.h | 2 +- src/ripple/overlay/impl/OverlayImpl.h | 11 ++-- src/ripple/peerfinder/impl/Logic.h | 1 - src/ripple/peerfinder/sim/Tests.cpp | 3 +- src/ripple/resource/impl/Logic.h | 4 +- src/ripple/sitefiles/api/Section.h | 2 +- src/ripple/sitefiles/api/SiteFile.h | 3 +- src/ripple/sitefiles/impl/Logic.h | 2 +- src/ripple/testoverlay/api/ConnectionType.h | 2 +- src/ripple/testoverlay/api/PeerType.h | 2 +- src/ripple/testoverlay/impl/TestOverlay.cpp | 2 +- src/ripple/types/api/IdentifierStorage.h | 2 +- src/ripple/types/api/UintTypes.h | 7 ++- src/ripple/types/api/base_uint.h | 4 +- src/ripple/types/impl/Issue.cpp | 34 ++++++------- src/ripple/unity/app.h | 1 - src/ripple/unity/net.h | 2 - src/ripple/unity/peerfinder.cpp | 1 - src/ripple/unity/testoverlay.h | 2 - src/ripple/unity/types.cpp | 3 -- src/ripple/unity/types.h | 1 - src/ripple/unity/validators.cpp | 1 - src/ripple/validators/impl/ChosenList.h | 3 +- src/ripple/validators/impl/Logic.h | 5 +- src/ripple/validators/impl/Tuning.h | 3 +- src/ripple/validators/impl/Validator.h | 5 +- 64 files changed, 179 insertions(+), 170 deletions(-) diff --git a/src/ripple/basics/containers/SyncUnorderedMap.h b/src/ripple/basics/containers/SyncUnorderedMap.h index a6338056f..06f286f64 100644 --- a/src/ripple/basics/containers/SyncUnorderedMap.h +++ b/src/ripple/basics/containers/SyncUnorderedMap.h @@ -43,7 +43,7 @@ class SyncUnorderedMapType : public SyncUnorderedMap public: typedef c_Key key_type; typedef c_Data data_type; - typedef ripple::unordered_map map_type; + typedef hash_map map_type; class iterator { diff --git a/src/ripple/basics/log/Log.h b/src/ripple/basics/log/Log.h index 6f2e27089..c26a97700 100644 --- a/src/ripple/basics/log/Log.h +++ b/src/ripple/basics/log/Log.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_BASICS_LOG_H_INCLUDED #define RIPPLE_BASICS_LOG_H_INCLUDED +#include #include #include #include @@ -139,7 +140,7 @@ private: }; std::mutex mutable mutex_; - std::unordered_map sinks_; + hardened_hash_map sinks_; beast::Journal::Severity level_; File file_; diff --git a/src/ripple/common/KeyCache.h b/src/ripple/common/KeyCache.h index 32922a799..4673d3f66 100644 --- a/src/ripple/common/KeyCache.h +++ b/src/ripple/common/KeyCache.h @@ -21,7 +21,6 @@ #define RIPPLE_KEYCACHE_H_INCLUDED #include -#include #include #include @@ -40,7 +39,7 @@ namespace ripple { // VFALCO TODO Figure out how to pass through the allocator template < class Key, - class Hash = beast::hardened_hash , + class Hash = beast::hardened_hash <>, class KeyEqual = std::equal_to , //class Allocator = std::allocator >, class Mutex = std::mutex @@ -82,7 +81,7 @@ private: clock_type::time_point last_access; }; - typedef ripple::unordered_map map_type; + typedef hardened_hash_map map_type; typedef typename map_type::iterator iterator; typedef std::lock_guard lock_guard; diff --git a/src/ripple/common/TaggedCache.h b/src/ripple/common/TaggedCache.h index 752ca3ebb..f25e11579 100644 --- a/src/ripple/common/TaggedCache.h +++ b/src/ripple/common/TaggedCache.h @@ -27,7 +27,6 @@ #include #include #include -#include #include namespace ripple { @@ -51,7 +50,7 @@ struct TaggedCacheLog; template < class Key, class T, - class Hash = beast::hardened_hash , + class Hash = beast::hardened_hash <>, class KeyEqual = std::equal_to , //class Allocator = std::allocator >, class Mutex = std::recursive_mutex @@ -528,7 +527,7 @@ private: }; typedef std::pair cache_pair; - typedef ripple::unordered_map cache_type; + typedef hardened_hash_map cache_type; typedef typename cache_type::iterator cache_iterator; beast::Journal m_journal; diff --git a/src/ripple/common/UnorderedContainers.h b/src/ripple/common/UnorderedContainers.h index 3e2ba8af8..c30df2ae4 100644 --- a/src/ripple/common/UnorderedContainers.h +++ b/src/ripple/common/UnorderedContainers.h @@ -20,23 +20,69 @@ #ifndef RIPPLE_UNORDERED_CONTAINERS_H #define RIPPLE_UNORDERED_CONTAINERS_H +#include #include #include #include +/** +* Use hash_* containers for keys that do not need a cryptographically secure +* hashing algorithm. +* +* Use hardened_hash_* containers for keys that do need a secure hashing algorithm. +* +* The cryptographic security of containers where a hash function is used as a +* template parameter depends entirely on that hash function and not at all on +* what container it is. +*/ + namespace ripple { +// hash containers + template , class Pred = std::equal_to, class Allocator = std::allocator>> -using unordered_map = std::unordered_map ; +using hash_map = std::unordered_map ; + +template , + class Pred = std::equal_to, + class Allocator = std::allocator>> +using hash_multimap = std::unordered_multimap ; template , class Pred = std::equal_to, class Allocator = std::allocator> -using unordered_set = std::unordered_set ; +using hash_set = std::unordered_set ; + +template , + class Pred = std::equal_to, + class Allocator = std::allocator> +using hash_multiset = std::unordered_multiset ; + +// hardened_hash containers + +template , + class Pred = std::equal_to, + class Allocator = std::allocator>> +using hardened_hash_map = std::unordered_map ; + +template , + class Pred = std::equal_to, + class Allocator = std::allocator>> +using hardened_hash_multimap = std::unordered_multimap ; + +template , + class Pred = std::equal_to, + class Allocator = std::allocator> +using hardened_hash_set = std::unordered_set ; + +template , + class Pred = std::equal_to, + class Allocator = std::allocator> +using hardened_hash_multiset = std::unordered_multiset ; } // ripple diff --git a/src/ripple/module/app/consensus/DisputedTx.h b/src/ripple/module/app/consensus/DisputedTx.h index a36474268..f4720af15 100644 --- a/src/ripple/module/app/consensus/DisputedTx.h +++ b/src/ripple/module/app/consensus/DisputedTx.h @@ -79,7 +79,7 @@ private: bool mOurVote; Serializer transaction; - ripple::unordered_map mVotes; + hash_map mVotes; }; // How many total extra passes we make diff --git a/src/ripple/module/app/consensus/LedgerConsensus.cpp b/src/ripple/module/app/consensus/LedgerConsensus.cpp index baabb6cc8..57c5fb5fc 100644 --- a/src/ripple/module/app/consensus/LedgerConsensus.cpp +++ b/src/ripple/module/app/consensus/LedgerConsensus.cpp @@ -475,7 +475,7 @@ public: // Get validators that are on our ledger, or "close" to being on // our ledger. - ripple::unordered_map vals = + hash_map vals = getApp().getValidations ().getCurrentValidations (favoredLedger, priorLedger); @@ -1687,7 +1687,7 @@ private: } // if any peers have taken a contrary position, process disputes - ripple::unordered_set found; + hash_set found; for (auto& it : mPeerPositions) { @@ -2093,19 +2093,18 @@ private: int mPreviousMSeconds; // Convergence tracking, trusted peers indexed by hash of public key - ripple::unordered_map mPeerPositions; + hash_map mPeerPositions; // Transaction Sets, indexed by hash of transaction tree - ripple::unordered_map mAcquired; - ripple::unordered_map mAcquiring; + hash_map mAcquired; + hash_map mAcquiring; // Peer sets - ripple::unordered_map > > mPeerData; + hash_map > > mPeerData; // Disputed transactions - ripple::unordered_map mDisputes; - ripple::unordered_set mCompares; + hash_map mDisputes; + hash_set mCompares; // Close time estimates std::map mCloseTimes; diff --git a/src/ripple/module/app/ledger/BookListeners.h b/src/ripple/module/app/ledger/BookListeners.h index 847daa926..7657f282b 100644 --- a/src/ripple/module/app/ledger/BookListeners.h +++ b/src/ripple/module/app/ledger/BookListeners.h @@ -39,7 +39,7 @@ private: typedef std::lock_guard ScopedLockType; LockType mLock; - ripple::unordered_map mListeners; + hash_map mListeners; }; } // ripple diff --git a/src/ripple/module/app/ledger/InboundLedgers.cpp b/src/ripple/module/app/ledger/InboundLedgers.cpp index b7716b229..94216be51 100644 --- a/src/ripple/module/app/ledger/InboundLedgers.cpp +++ b/src/ripple/module/app/ledger/InboundLedgers.cpp @@ -59,7 +59,7 @@ public: { if (mConsensusLedger.isNonZero() && (mValidationLedger != mConsensusLedger) && (hash != mConsensusLedger)) { - ripple::unordered_map::iterator it = mLedgers.find (mConsensusLedger); + hash_map::iterator it = mLedgers.find (mConsensusLedger); if (it != mLedgers.end ()) { oldLedger = it->second; @@ -72,7 +72,7 @@ public: { if (mValidationLedger.isNonZero() && (mValidationLedger != mConsensusLedger) && (hash != mValidationLedger)) { - ripple::unordered_map::iterator it = mLedgers.find (mValidationLedger); + hash_map::iterator it = mLedgers.find (mValidationLedger); if (it != mLedgers.end ()) { oldLedger = it->second; @@ -82,7 +82,7 @@ public: mValidationLedger = hash; } - ripple::unordered_map::iterator it = mLedgers.find (hash); + hash_map::iterator it = mLedgers.find (hash); if (it != mLedgers.end ()) { ret = it->second; @@ -111,7 +111,7 @@ public: { ScopedLockType sl (mLock); - ripple::unordered_map::iterator it = mLedgers.find (hash); + hash_map::iterator it = mLedgers.find (hash); if (it != mLedgers.end ()) { ret = it->second; @@ -376,7 +376,7 @@ public: private: clock_type& m_clock; - typedef ripple::unordered_map MapType; + typedef hash_map MapType; typedef RippleRecursiveMutex LockType; typedef std::unique_lock ScopedLockType; diff --git a/src/ripple/module/app/ledger/LedgerEntrySet.h b/src/ripple/module/app/ledger/LedgerEntrySet.h index 0d4cadacb..fc2f18fd8 100644 --- a/src/ripple/module/app/ledger/LedgerEntrySet.h +++ b/src/ripple/module/app/ledger/LedgerEntrySet.h @@ -292,7 +292,7 @@ private: Ledger::pointer mLedger; std::map mEntries; // cannot be unordered! - typedef ripple::unordered_map NodeToLedgerEntry; + typedef hash_map NodeToLedgerEntry; TransactionMetaSet mSet; TransactionEngineParams mParams; diff --git a/src/ripple/module/app/ledger/LedgerMaster.cpp b/src/ripple/module/app/ledger/LedgerMaster.cpp index 5834a3e84..2d8a4d820 100644 --- a/src/ripple/module/app/ledger/LedgerMaster.cpp +++ b/src/ripple/module/app/ledger/LedgerMaster.cpp @@ -818,7 +818,7 @@ public: }; // Count the number of current, trusted validations - ripple::unordered_map count; + hash_map count; for (auto const& v : val) { valSeq& vs = count[v->getLedgerHash()]; diff --git a/src/ripple/module/app/ledger/OrderBookDB.cpp b/src/ripple/module/app/ledger/OrderBookDB.cpp index ce39a95bd..9721f86bc 100644 --- a/src/ripple/module/app/ledger/OrderBookDB.cpp +++ b/src/ripple/module/app/ledger/OrderBookDB.cpp @@ -62,10 +62,10 @@ void OrderBookDB::setup (Ledger::ref ledger) } static void updateHelper (SLE::ref entry, - ripple::unordered_set< uint256 >& seen, + hash_set< uint256 >& seen, OrderBookDB::IssueToOrderBook& destMap, OrderBookDB::IssueToOrderBook& sourceMap, - ripple::unordered_set< Issue >& XRPBooks, + hash_set< Issue >& XRPBooks, int& books) { if (entry->getType () == ltDIR_NODE && @@ -93,10 +93,10 @@ static void updateHelper (SLE::ref entry, void OrderBookDB::update (Ledger::pointer ledger) { - ripple::unordered_set< uint256 > seen; + hash_set< uint256 > seen; OrderBookDB::IssueToOrderBook destMap; OrderBookDB::IssueToOrderBook sourceMap; - ripple::unordered_set< Issue > XRPBooks; + hash_set< Issue > XRPBooks; WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update>"; diff --git a/src/ripple/module/app/ledger/OrderBookDB.h b/src/ripple/module/app/ledger/OrderBookDB.h index 06b059579..96bf16c72 100644 --- a/src/ripple/module/app/ledger/OrderBookDB.h +++ b/src/ripple/module/app/ledger/OrderBookDB.h @@ -51,7 +51,7 @@ public: Ledger::ref ledger, const AcceptedLedgerTx& alTx, Json::Value const& jvObj); - typedef ripple::unordered_map IssueToOrderBook; + typedef hash_map IssueToOrderBook; private: void rawAddBook(Book const&); @@ -63,13 +63,13 @@ private: IssueToOrderBook mDestMap; // does an order book to XRP exist - ripple::unordered_set mXRPBooks; + hash_set mXRPBooks; typedef RippleRecursiveMutex LockType; typedef std::lock_guard ScopedLockType; LockType mLock; - typedef ripple::unordered_map + typedef hash_map BookToListenersMap; BookToListenersMap mListeners; diff --git a/src/ripple/module/app/misc/AmendmentTable.h b/src/ripple/module/app/misc/AmendmentTable.h index 597cef3d2..43de517d2 100644 --- a/src/ripple/module/app/misc/AmendmentTable.h +++ b/src/ripple/module/app/misc/AmendmentTable.h @@ -30,7 +30,7 @@ class AmendmentSet public: std::uint32_t mCloseTime; int mTrustedValidations; // number of trusted validations - ripple::unordered_map mVotes; // yes votes by amendment + hash_map mVotes; // yes votes by amendment AmendmentSet (std::uint32_t ct) : mCloseTime (ct), mTrustedValidations (0) { diff --git a/src/ripple/module/app/misc/AmendmentTableImpl.cpp b/src/ripple/module/app/misc/AmendmentTableImpl.cpp index 73937b86a..df12021d5 100644 --- a/src/ripple/module/app/misc/AmendmentTableImpl.cpp +++ b/src/ripple/module/app/misc/AmendmentTableImpl.cpp @@ -29,9 +29,9 @@ namespace ripple { { protected: - typedef ripple::unordered_map amendmentMap_t; + typedef hash_map amendmentMap_t; typedef std::pair amendmentIt_t; - typedef ripple::unordered_set amendmentList_t; + typedef hash_set amendmentList_t; typedef RippleMutex LockType; typedef std::lock_guard ScopedLockType; diff --git a/src/ripple/module/app/misc/HashRouter.cpp b/src/ripple/module/app/misc/HashRouter.cpp index 494f0df0f..4c7e6c5c7 100644 --- a/src/ripple/module/app/misc/HashRouter.cpp +++ b/src/ripple/module/app/misc/HashRouter.cpp @@ -107,7 +107,7 @@ private: LockType mLock; // Stores all suppressed hashes and their expiration time - ripple::unordered_map mSuppressionMap; + hash_map mSuppressionMap; // Stores all expiration times and the hashes indexed for them std::map< int, std::list > mSuppressionTimes; @@ -119,7 +119,7 @@ private: HashRouter::Entry& HashRouter::findCreateEntry (uint256 const& index, bool& created) { - ripple::unordered_map::iterator fit = mSuppressionMap.find (index); + hash_map::iterator fit = mSuppressionMap.find (index); if (fit != mSuppressionMap.end ()) { diff --git a/src/ripple/module/app/misc/NetworkOPs.cpp b/src/ripple/module/app/misc/NetworkOPs.cpp index cb687e1b1..b5183f16b 100644 --- a/src/ripple/module/app/misc/NetworkOPs.cpp +++ b/src/ripple/module/app/misc/NetworkOPs.cpp @@ -427,11 +427,10 @@ public: // void subAccount ( InfoSub::ref ispListener, - const ripple::unordered_set& vnaAccountIDs, + const hash_set& vnaAccountIDs, std::uint32_t uLedgerIndex, bool rt); void unsubAccount ( - std::uint64_t uListener, - const ripple::unordered_set& vnaAccountIDs, + std::uint64_t uListener, const hash_set& vnaAccountIDs, bool rt); bool subLedger (InfoSub::ref ispListener, Json::Value& jvResult); @@ -492,8 +491,8 @@ private: private: clock_type& m_clock; - typedef ripple::unordered_map SubInfoMapType; - typedef ripple::unordered_map subRpcMapType; + typedef hash_map SubInfoMapType; + typedef hash_map subRpcMapType; // XXX Split into more locks. typedef RippleRecursiveMutex LockType; @@ -1358,7 +1357,7 @@ bool NetworkOPsImp::checkLastClosedLedger ( m_journal.trace << "OurClosed: " << closedLedger; m_journal.trace << "PrevClosed: " << prevClosedLedger; - ripple::unordered_map ledgers; + hash_map ledgers; { auto current = getApp().getValidations ().getCurrentValidations ( closedLedger, prevClosedLedger); @@ -2615,7 +2614,7 @@ void NetworkOPsImp::pubValidatedTransaction (Ledger::ref alAccepted, const Accep void NetworkOPsImp::pubAccountTransaction (Ledger::ref lpCurrent, const AcceptedLedgerTx& alTx, bool bAccepted) { - std::unordered_set notify; + hash_set notify; int iProposed = 0; int iAccepted = 0; @@ -2702,7 +2701,7 @@ void NetworkOPsImp::pubAccountTransaction (Ledger::ref lpCurrent, const Accepted // void NetworkOPsImp::subAccount (InfoSub::ref isrListener, - const ripple::unordered_set& vnaAccountIDs, + const hash_set& vnaAccountIDs, std::uint32_t uLedgerIndex, bool rt) { SubInfoMapType& subMap = rt ? mSubRTAccount : mSubAccount; @@ -2738,7 +2737,7 @@ void NetworkOPsImp::subAccount (InfoSub::ref isrListener, } void NetworkOPsImp::unsubAccount (std::uint64_t uSeq, - const ripple::unordered_set& vnaAccountIDs, + const hash_set& vnaAccountIDs, bool rt) { SubInfoMapType& subMap = rt ? mSubRTAccount : mSubAccount; diff --git a/src/ripple/module/app/misc/NetworkOPs.h b/src/ripple/module/app/misc/NetworkOPs.h index e2357d063..faac40b37 100644 --- a/src/ripple/module/app/misc/NetworkOPs.h +++ b/src/ripple/module/app/misc/NetworkOPs.h @@ -81,7 +81,7 @@ public: // VFALCO TODO Fix OrderBookDB to not need this unrelated type. // - typedef ripple::unordered_map SubMapType; + typedef hash_map SubMapType; public: // VFALCO TODO Make LedgerMaster a SharedPtr or a reference. @@ -264,8 +264,7 @@ public: virtual Json::Value getLedgerFetchInfo () = 0; virtual std::uint32_t acceptLedger () = 0; - typedef ripple::unordered_map > - Proposals; + typedef hash_map > Proposals; virtual Proposals& peekStoredProposals () = 0; virtual void storeProposal (LedgerProposal::ref proposal, diff --git a/src/ripple/module/app/misc/Validations.h b/src/ripple/module/app/misc/Validations.h index 15b49547a..5dea10e35 100644 --- a/src/ripple/module/app/misc/Validations.h +++ b/src/ripple/module/app/misc/Validations.h @@ -25,10 +25,10 @@ namespace ripple { // VFALCO TODO rename and move these typedefs into the Validations interface // nodes validating and highest node ID validating -typedef unordered_map ValidationSet; +typedef hash_map ValidationSet; typedef std::pair ValidationCounter; -typedef unordered_map LedgerToValidationCounter; +typedef hash_map LedgerToValidationCounter; typedef std::vector ValidationVector; class Validations : beast::LeakChecked diff --git a/src/ripple/module/app/paths/Calculators.h b/src/ripple/module/app/paths/Calculators.h index 43a51019a..db784394a 100644 --- a/src/ripple/module/app/paths/Calculators.h +++ b/src/ripple/module/app/paths/Calculators.h @@ -50,7 +50,7 @@ public: // unfunded offers. // // Offers that were found unfunded. - unordered_set mUnfundedOffers; + hash_set mUnfundedOffers; RippleCalc (LedgerEntrySet& activeLedger, const bool bOpenLedger) : mActiveLedger (activeLedger), mOpenLedger (bOpenLedger) diff --git a/src/ripple/module/app/paths/Pathfinder.h b/src/ripple/module/app/paths/Pathfinder.h index 94300425d..fce606e55 100644 --- a/src/ripple/module/app/paths/Pathfinder.h +++ b/src/ripple/module/app/paths/Pathfinder.h @@ -146,7 +146,7 @@ private: STPathSet mCompletePaths; std::map< PathType_t, STPathSet > mPaths; - ripple::unordered_map, int> mPOMap; + hash_map, int> mPOMap; // Add ripple paths static const std::uint32_t afADD_ACCOUNTS = 0x001; diff --git a/src/ripple/module/app/paths/RippleLineCache.h b/src/ripple/module/app/paths/RippleLineCache.h index 58adf9d82..0be2219f0 100644 --- a/src/ripple/module/app/paths/RippleLineCache.h +++ b/src/ripple/module/app/paths/RippleLineCache.h @@ -45,7 +45,7 @@ private: Ledger::pointer mLedger; - ripple::unordered_map mRLMap; + hash_map mRLMap; }; } // ripple diff --git a/src/ripple/module/app/paths/Types.h b/src/ripple/module/app/paths/Types.h index 2de6e7130..cec206b07 100644 --- a/src/ripple/module/app/paths/Types.h +++ b/src/ripple/module/app/paths/Types.h @@ -26,7 +26,7 @@ namespace ripple { typedef std::tuple AccountCurrencyIssuer; // Map of account, currency, issuer to node index. -typedef ripple::unordered_map +typedef hash_map AccountCurrencyIssuerToNodeIndex; } // ripple diff --git a/src/ripple/module/app/peers/PeerSet.h b/src/ripple/module/app/peers/PeerSet.h index a92313cdd..e6425de76 100644 --- a/src/ripple/module/app/peers/PeerSet.h +++ b/src/ripple/module/app/peers/PeerSet.h @@ -155,7 +155,7 @@ protected: // VFALCO TODO Verify that these are used in the way that the names suggest. typedef Peer::ShortId PeerIdentifier; typedef int ReceivedChunkCount; - typedef ripple::unordered_map PeerSetMap; + typedef hash_map PeerSetMap; PeerSetMap mPeers; }; diff --git a/src/ripple/module/app/peers/UniqueNodeList.cpp b/src/ripple/module/app/peers/UniqueNodeList.cpp index 61ff4b010..2346e5cb8 100644 --- a/src/ripple/module/app/peers/UniqueNodeList.cpp +++ b/src/ripple/module/app/peers/UniqueNodeList.cpp @@ -103,9 +103,9 @@ private: std::vector viReferrals; } scoreNode; - typedef ripple::unordered_map strIndex; + typedef hash_map strIndex; typedef std::pair IPAndPortNumber; - typedef ripple::unordered_map, score> epScore; + typedef hash_map, score> epScore; public: explicit UniqueNodeListImp (Stoppable& parent) @@ -1025,7 +1025,7 @@ private: } } - ripple::unordered_set usUNL; + hash_set usUNL; if (!vsnNodes.empty ()) { @@ -1058,7 +1058,7 @@ private: mUNL.swap (usUNL); } - ripple::unordered_map umValidators; + hash_map umValidators; if (!vsnNodes.empty ()) { @@ -1077,7 +1077,7 @@ private: // map of pair :: score epScore umScore; - typedef ripple::unordered_map::value_type vcType; + typedef hash_map::value_type vcType; BOOST_FOREACH (vcType & vc, umValidators) { std::string strValidator = vc.first; @@ -2025,7 +2025,7 @@ private: // XXX Make this faster, make this the contents vector unsigned char or raw public key. // XXX Contents needs to based on score. - ripple::unordered_set mUNL; + hash_set mUNL; boost::posix_time::ptime mtpScoreNext; // When to start scoring. boost::posix_time::ptime mtpScoreStart; // Time currently started scoring. diff --git a/src/ripple/module/app/shamap/FetchPackTests.cpp b/src/ripple/module/app/shamap/FetchPackTests.cpp index e45d2b682..caff9a78c 100644 --- a/src/ripple/module/app/shamap/FetchPackTests.cpp +++ b/src/ripple/module/app/shamap/FetchPackTests.cpp @@ -32,7 +32,7 @@ public: tableItemsExtra = 20 }; - typedef ripple::unordered_map Map; + typedef hash_map Map; struct TestFilter : SHAMapSyncFilter { diff --git a/src/ripple/module/app/shamap/SHAMap.cpp b/src/ripple/module/app/shamap/SHAMap.cpp index 1dfaf02d4..c3a7e2682 100644 --- a/src/ripple/module/app/shamap/SHAMap.cpp +++ b/src/ripple/module/app/shamap/SHAMap.cpp @@ -1302,11 +1302,10 @@ void SHAMap::dump (bool hash) WriteLog (lsINFO, SHAMap) << " MAP Contains"; ScopedWriteLockType sl (mLock); - for (ripple::unordered_map::iterator it = mTNByID.peekMap().begin (); - it != mTNByID.peekMap().end (); ++it) + for (auto const& p : mTNByID.peekMap()) { - WriteLog (lsINFO, SHAMap) << it->second->getString (it->first); - CondLog (hash, lsINFO, SHAMap) << it->second->getNodeHash (); + WriteLog (lsINFO, SHAMap) << p.second->getString (p.first); + CondLog (hash, lsINFO, SHAMap) << p.second->getNodeHash (); } } diff --git a/src/ripple/module/app/shamap/SHAMap.h b/src/ripple/module/app/shamap/SHAMap.h index 41a982010..9416e8bea 100644 --- a/src/ripple/module/app/shamap/SHAMap.h +++ b/src/ripple/module/app/shamap/SHAMap.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_SHAMAP_H #define RIPPLE_SHAMAP_H +#include #include #include #include @@ -27,8 +28,6 @@ #include #include -#include - namespace std { template <> @@ -114,8 +113,8 @@ public: typedef std::pair DeltaItem; typedef std::pair DeltaRef; typedef std::map Delta; - typedef ripple::unordered_map NodeMap; - typedef std::unordered_set DirtySet; + typedef hash_map NodeMap; + typedef hash_set DirtySet; typedef boost::shared_mutex LockType; typedef boost::shared_lock ScopedReadLockType; diff --git a/src/ripple/module/app/transactors/CreateOfferBridged.h b/src/ripple/module/app/transactors/CreateOfferBridged.h index 1c8da659d..f614fef43 100644 --- a/src/ripple/module/app/transactors/CreateOfferBridged.h +++ b/src/ripple/module/app/transactors/CreateOfferBridged.h @@ -22,8 +22,6 @@ #include -#include - namespace ripple { class CreateOfferBridged diff --git a/src/ripple/module/app/transactors/CreateOfferDirect.h b/src/ripple/module/app/transactors/CreateOfferDirect.h index ffa283232..89ceef52c 100644 --- a/src/ripple/module/app/transactors/CreateOfferDirect.h +++ b/src/ripple/module/app/transactors/CreateOfferDirect.h @@ -22,8 +22,6 @@ #include -#include - namespace ripple { class CreateOfferDirect diff --git a/src/ripple/module/app/websocket/WSServerHandler.h b/src/ripple/module/app/websocket/WSServerHandler.h index a9480c483..474643b0f 100644 --- a/src/ripple/module/app/websocket/WSServerHandler.h +++ b/src/ripple/module/app/websocket/WSServerHandler.h @@ -74,8 +74,7 @@ private: protected: // For each connection maintain an associated object to track subscriptions. - typedef ripple::unordered_map > > MapType; + typedef hash_map MapType; MapType mMap; bool const mPublic; bool const mProxy; @@ -148,7 +147,7 @@ public: wsc_ptr ptr; { ScopedLockType sl (mLock); - typename ripple::unordered_map::iterator it = mMap.find (cpClient); + auto it = mMap.find (cpClient); if (it == mMap.end ()) return; @@ -178,7 +177,7 @@ public: wsc_ptr ptr; { ScopedLockType sl (mLock); - typename ripple::unordered_map::iterator it = mMap.find (cpClient); + auto it = mMap.find (cpClient); if (it == mMap.end ()) return; @@ -213,7 +212,7 @@ public: wsc_ptr ptr; { ScopedLockType sl (mLock); - typename ripple::unordered_map::iterator it = mMap.find (cpClient); + auto it = mMap.find (cpClient); if (it == mMap.end ()) return; @@ -247,7 +246,7 @@ public: wsc_ptr ptr; { ScopedLockType sl (mLock); - typename ripple::unordered_map::iterator it = mMap.find (cpClient); + auto it = mMap.find (cpClient); if (it == mMap.end ()) { @@ -287,7 +286,7 @@ public: wsc_ptr ptr; { ScopedLockType sl (mLock); - typename ripple::unordered_map::iterator it = mMap.find (cpClient); + auto it = mMap.find (cpClient); if (it == mMap.end ()) return; @@ -322,7 +321,7 @@ public: wsc_ptr ptr; { ScopedLockType sl (mLock); - typename ripple::unordered_map::iterator it = mMap.find (cpClient); + auto it = mMap.find (cpClient); if (it == mMap.end ()) return; diff --git a/src/ripple/module/core/functional/JobQueue.cpp b/src/ripple/module/core/functional/JobQueue.cpp index 25767b0b2..0648caf5e 100644 --- a/src/ripple/module/core/functional/JobQueue.cpp +++ b/src/ripple/module/core/functional/JobQueue.cpp @@ -623,7 +623,7 @@ private: ScopedLock lock (m_mutex); // Remove all jobs whose type is skipOnStop - typedef ripple::unordered_map JobDataMap; + typedef hash_map JobDataMap; JobDataMap counts; bool const report (m_journal.debug.active()); diff --git a/src/ripple/module/data/protocol/RippleAddress.cpp b/src/ripple/module/data/protocol/RippleAddress.cpp index c13b05754..d98e2ac42 100644 --- a/src/ripple/module/data/protocol/RippleAddress.cpp +++ b/src/ripple/module/data/protocol/RippleAddress.cpp @@ -318,7 +318,7 @@ typedef RippleMutex StaticLockType; typedef std::lock_guard StaticScopedLockType; static StaticLockType s_lock; -static ripple::unordered_map< Blob , std::string > rncMap; +static hash_map< Blob , std::string > rncMap; std::string RippleAddress::humanAccountID () const { diff --git a/src/ripple/module/net/rpc/InfoSub.h b/src/ripple/module/net/rpc/InfoSub.h index 2c1986aae..c22347c67 100644 --- a/src/ripple/module/net/rpc/InfoSub.h +++ b/src/ripple/module/net/rpc/InfoSub.h @@ -55,11 +55,11 @@ public: public: // VFALCO TODO Rename the 'rt' parameters to something meaningful. virtual void subAccount (ref ispListener, - const ripple::unordered_set& vnaAccountIDs, + const hash_set& vnaAccountIDs, std::uint32_t uLedgerIndex, bool rt) = 0; virtual void unsubAccount (std::uint64_t uListener, - const ripple::unordered_set& vnaAccountIDs, + const hash_set& vnaAccountIDs, bool rt) = 0; // VFALCO TODO Document the bool return value @@ -117,13 +117,12 @@ protected: LockType mLock; private: - Consumer m_consumer; - Source& m_source; - ripple::unordered_set mSubAccountInfo; - ripple::unordered_set mSubAccountTransaction; - std::shared_ptr mPathRequest; - - std::uint64_t mSeq; + Consumer m_consumer; + Source& m_source; + hash_set mSubAccountInfo; + hash_set mSubAccountTransaction; + std::shared_ptr mPathRequest; + std::uint64_t mSeq; }; } // ripple diff --git a/src/ripple/module/rpc/handlers/Unsubscribe.cpp b/src/ripple/module/rpc/handlers/Unsubscribe.cpp index 59cf8a4d1..f95f9d07b 100644 --- a/src/ripple/module/rpc/handlers/Unsubscribe.cpp +++ b/src/ripple/module/rpc/handlers/Unsubscribe.cpp @@ -88,7 +88,7 @@ Json::Value doUnsubscribe (RPC::Context& context) if (context.params_.isMember ("accounts_proposed") || context.params_.isMember ("rt_accounts")) { - ripple::unordered_set usnaAccoundIds = RPC::parseAccountIds ( + hash_set usnaAccoundIds = RPC::parseAccountIds ( context.params_.isMember ("accounts_proposed") ? context.params_["accounts_proposed"] : context.params_["rt_accounts"]); // DEPRECATED @@ -105,7 +105,7 @@ Json::Value doUnsubscribe (RPC::Context& context) if (context.params_.isMember ("accounts")) { - ripple::unordered_set usnaAccoundIds = RPC::parseAccountIds (context.params_["accounts"]); + hash_set usnaAccoundIds = RPC::parseAccountIds (context.params_["accounts"]); if (usnaAccoundIds.empty ()) { diff --git a/src/ripple/module/rpc/impl/ErrorCodes.cpp b/src/ripple/module/rpc/impl/ErrorCodes.cpp index 39a46505e..5ae609d63 100644 --- a/src/ripple/module/rpc/impl/ErrorCodes.cpp +++ b/src/ripple/module/rpc/impl/ErrorCodes.cpp @@ -17,7 +17,6 @@ */ //============================================================================== -#include #include #include @@ -42,7 +41,7 @@ namespace detail { class ErrorCategory { public: - typedef ripple::unordered_map Map; + typedef hash_map Map; ErrorCategory () : m_unknown (rpcUNKNOWN, "unknown", "An unknown error code.") diff --git a/src/ripple/module/rpc/impl/Manager.cpp b/src/ripple/module/rpc/impl/Manager.cpp index ced4e7052..3c309bc7a 100644 --- a/src/ripple/module/rpc/impl/Manager.cpp +++ b/src/ripple/module/rpc/impl/Manager.cpp @@ -28,7 +28,7 @@ namespace RPC { class ManagerImp : public Manager { public: - typedef ripple::unordered_map Map; + typedef hash_map Map; beast::Journal m_journal; Map m_map; diff --git a/src/ripple/module/rpc/impl/ParseAccountIds.cpp b/src/ripple/module/rpc/impl/ParseAccountIds.cpp index daea4936e..d627b3bdb 100644 --- a/src/ripple/module/rpc/impl/ParseAccountIds.cpp +++ b/src/ripple/module/rpc/impl/ParseAccountIds.cpp @@ -22,9 +22,9 @@ namespace ripple { namespace RPC { -ripple::unordered_set parseAccountIds (const Json::Value& jvArray) +hash_set parseAccountIds (const Json::Value& jvArray) { - ripple::unordered_set usnaResult; + hash_set usnaResult; for (Json::Value::const_iterator it = jvArray.begin (); it != jvArray.end (); it++) { diff --git a/src/ripple/module/rpc/impl/ParseAccountIds.h b/src/ripple/module/rpc/impl/ParseAccountIds.h index fe1d95398..e63470ed7 100644 --- a/src/ripple/module/rpc/impl/ParseAccountIds.h +++ b/src/ripple/module/rpc/impl/ParseAccountIds.h @@ -23,7 +23,7 @@ namespace ripple { namespace RPC { -ripple::unordered_set parseAccountIds (const Json::Value& jvArray); +hash_set parseAccountIds (const Json::Value& jvArray); } // RPC } // ripple diff --git a/src/ripple/overlay/impl/OverlayImpl.h b/src/ripple/overlay/impl/OverlayImpl.h index ac3443051..63c94994b 100644 --- a/src/ripple/overlay/impl/OverlayImpl.h +++ b/src/ripple/overlay/impl/OverlayImpl.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -49,14 +50,12 @@ class OverlayImpl private: typedef boost::asio::ip::tcp::socket socket_type; - typedef std::unordered_map > PeersBySlot; + typedef hash_map > PeersBySlot; - typedef ripple::unordered_map < - RippleAddress, Peer::ptr> PeerByPublicKey; + typedef hash_map PeerByPublicKey; - typedef std::unordered_map < - Peer::ShortId, Peer::ptr> PeerByShortId; + typedef hash_map PeerByShortId; std::recursive_mutex m_mutex; diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index 8259a1cd6..812e5d29f 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -32,7 +32,6 @@ #include #include -#include namespace ripple { namespace PeerFinder { diff --git a/src/ripple/peerfinder/sim/Tests.cpp b/src/ripple/peerfinder/sim/Tests.cpp index e03ce7bb3..d4389e0cc 100644 --- a/src/ripple/peerfinder/sim/Tests.cpp +++ b/src/ripple/peerfinder/sim/Tests.cpp @@ -38,8 +38,7 @@ class Network public: typedef std::list Peers; - typedef ripple::unordered_map < - IP::Endpoint, boost::reference_wrapper > Table; + typedef hash_map > Table; explicit Network (Params const& params, Journal journal = Journal()); diff --git a/src/ripple/resource/impl/Logic.h b/src/ripple/resource/impl/Logic.h index 306852039..ff3d0039e 100644 --- a/src/ripple/resource/impl/Logic.h +++ b/src/ripple/resource/impl/Logic.h @@ -31,8 +31,8 @@ class Logic { private: typedef beast::abstract_clock clock_type; - typedef ripple::unordered_map Imports; - typedef ripple::unordered_map Table; + typedef hash_map Imports; + typedef hash_map Table; typedef beast::List EntryIntrusiveList; struct State diff --git a/src/ripple/sitefiles/api/Section.h b/src/ripple/sitefiles/api/Section.h index 4d7730988..9050cce12 100644 --- a/src/ripple/sitefiles/api/Section.h +++ b/src/ripple/sitefiles/api/Section.h @@ -33,7 +33,7 @@ namespace SiteFiles { class Section { public: - typedef ripple::unordered_map MapType; + typedef hash_map MapType; typedef std::vector DataType; Section(int = 0); // dummy argument for emplace() diff --git a/src/ripple/sitefiles/api/SiteFile.h b/src/ripple/sitefiles/api/SiteFile.h index 1f74a07f1..ad06f5979 100644 --- a/src/ripple/sitefiles/api/SiteFile.h +++ b/src/ripple/sitefiles/api/SiteFile.h @@ -24,7 +24,6 @@ #include #include -#include namespace ripple { namespace SiteFiles { @@ -34,7 +33,7 @@ class SiteFile public: SiteFile (int = 0); // dummy argument for emplace - typedef ripple::unordered_map SectionsType; + typedef hash_map SectionsType; /** Retrieve a section by name. */ /** @{ */ diff --git a/src/ripple/sitefiles/impl/Logic.h b/src/ripple/sitefiles/impl/Logic.h index 1f242b915..0b74b6534 100644 --- a/src/ripple/sitefiles/impl/Logic.h +++ b/src/ripple/sitefiles/impl/Logic.h @@ -62,7 +62,7 @@ class Logic { public: typedef std::set Listeners; - typedef ripple::unordered_map SiteFiles; + typedef hash_map SiteFiles; struct State { diff --git a/src/ripple/testoverlay/api/ConnectionType.h b/src/ripple/testoverlay/api/ConnectionType.h index d22a3f137..3e9beaf3d 100644 --- a/src/ripple/testoverlay/api/ConnectionType.h +++ b/src/ripple/testoverlay/api/ConnectionType.h @@ -41,7 +41,7 @@ public: typedef typename State::UniqueID UniqueID; typedef std::vector Messages; - typedef ripple::unordered_set MessageTable; + typedef hash_set MessageTable; /** Create the 'no connection' object. */ ConnectionType () diff --git a/src/ripple/testoverlay/api/PeerType.h b/src/ripple/testoverlay/api/PeerType.h index 7d13c2031..60775b191 100644 --- a/src/ripple/testoverlay/api/PeerType.h +++ b/src/ripple/testoverlay/api/PeerType.h @@ -42,7 +42,7 @@ public: typedef ConnectionType Connection; typedef std::vector Connections; - typedef ripple::unordered_set MessageTable; + typedef hash_set MessageTable; explicit PeerType (Network& network) : m_network (network) diff --git a/src/ripple/testoverlay/impl/TestOverlay.cpp b/src/ripple/testoverlay/impl/TestOverlay.cpp index 144287bf2..6318a0d76 100644 --- a/src/ripple/testoverlay/impl/TestOverlay.cpp +++ b/src/ripple/testoverlay/impl/TestOverlay.cpp @@ -411,7 +411,7 @@ public: } }; - typedef ripple::unordered_map PeerMap; + typedef hash_map PeerMap; BasicNetwork() { diff --git a/src/ripple/types/api/IdentifierStorage.h b/src/ripple/types/api/IdentifierStorage.h index 2128bb163..a8e78bb28 100644 --- a/src/ripple/types/api/IdentifierStorage.h +++ b/src/ripple/types/api/IdentifierStorage.h @@ -51,7 +51,7 @@ public: /** Value hashing function. The seed prevents crafted inputs from causing degenarate parent containers. */ - typedef beast::hardened_hash hasher; + typedef beast::hardened_hash <> hasher; /** Container equality testing function. */ class key_equal diff --git a/src/ripple/types/api/UintTypes.h b/src/ripple/types/api/UintTypes.h index 2409c82de..5ebae7232 100644 --- a/src/ripple/types/api/UintTypes.h +++ b/src/ripple/types/api/UintTypes.h @@ -20,8 +20,7 @@ #ifndef RIPPLE_TYPES_BASICS #define RIPPLE_TYPES_BASICS -#include - +#include #include namespace ripple { @@ -47,8 +46,8 @@ typedef base_uint<160, detail::CurrencyTag> Currency; /** NodeID is a 160-bit hash representing one node. */ typedef base_uint<160, detail::NodeIDTag> NodeID; -typedef std::unordered_set CurrencySet; -typedef std::unordered_set NodeIDSet; +typedef hash_set CurrencySet; +typedef hash_set NodeIDSet; /** A special account that's used as the "issuer" for XRP. */ Account const& xrpAccount(); diff --git a/src/ripple/types/api/base_uint.h b/src/ripple/types/api/base_uint.h index d4eb55ce1..ae7f6d1fd 100644 --- a/src/ripple/types/api/base_uint.h +++ b/src/ripple/types/api/base_uint.h @@ -98,7 +98,7 @@ public: /** Value hashing function. The seed prevents crafted inputs from causing degenarate parent containers. */ - typedef beast::hardened_hash hasher; + typedef beast::hardened_hash <> hasher; /** Container equality testing function. */ class key_equal @@ -532,7 +532,7 @@ struct hash> std::size_t operator()(argument_type const& u) const { - return beast::hardened_hash{}(u); + return beast::hardened_hash<>{}(u); } }; diff --git a/src/ripple/types/impl/Issue.cpp b/src/ripple/types/impl/Issue.cpp index b727fc54d..1810d175f 100644 --- a/src/ripple/types/impl/Issue.cpp +++ b/src/ripple/types/impl/Issue.cpp @@ -21,8 +21,6 @@ #include -#include - #include #include #include @@ -222,11 +220,11 @@ public: testIssueSet > (); #endif - testcase ("ripple::unordered_set "); - testIssueSet > (); + testcase ("hash_set "); + testIssueSet > (); - testcase ("ripple::unordered_set "); - testIssueSet > (); + testcase ("hash_set "); + testIssueSet > (); } void testIssueMaps () @@ -244,11 +242,11 @@ public: testcase ("std::unordered_map "); testIssueMap > (); - testcase ("ripple::unordered_map "); - testIssueMap > (); + testcase ("hash_map "); + testIssueMap > (); - testcase ("ripple::unordered_map "); - testIssueMap > (); + testcase ("hash_map "); + testIssueMap > (); #endif } @@ -425,11 +423,11 @@ public: testBookSet > (); #endif - testcase ("ripple::unordered_set "); - testBookSet > (); + testcase ("hash_set "); + testBookSet > (); - testcase ("ripple::unordered_set "); - testBookSet > (); + testcase ("hash_set "); + testBookSet > (); } void testBookMaps () @@ -447,11 +445,11 @@ public: testcase ("std::unordered_map "); testBookMap > (); - testcase ("ripple::unordered_map "); - testBookMap > (); + testcase ("hash_map "); + testBookMap > (); - testcase ("ripple::unordered_map "); - testBookMap > (); + testcase ("hash_map "); + testBookMap > (); #endif } diff --git a/src/ripple/unity/app.h b/src/ripple/unity/app.h index e5747e8ee..072b35b4a 100644 --- a/src/ripple/unity/app.h +++ b/src/ripple/unity/app.h @@ -38,7 +38,6 @@ #include #include #include -#include #include #include diff --git a/src/ripple/unity/net.h b/src/ripple/unity/net.h index 777174a43..ddb915947 100644 --- a/src/ripple/unity/net.h +++ b/src/ripple/unity/net.h @@ -20,8 +20,6 @@ #ifndef RIPPLE_NET_H_INCLUDED #define RIPPLE_NET_H_INCLUDED -#include // For InfoSub - #include #undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER /**/ diff --git a/src/ripple/unity/peerfinder.cpp b/src/ripple/unity/peerfinder.cpp index d3c5c023d..41efb758f 100644 --- a/src/ripple/unity/peerfinder.cpp +++ b/src/ripple/unity/peerfinder.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include diff --git a/src/ripple/unity/testoverlay.h b/src/ripple/unity/testoverlay.h index da69608b5..f7ffcb83b 100644 --- a/src/ripple/unity/testoverlay.h +++ b/src/ripple/unity/testoverlay.h @@ -20,8 +20,6 @@ #ifndef RIPPLE_TESTOVERLAY_H_INCLUDED #define RIPPLE_TESTOVERLAY_H_INCLUDED -#include - #include #include diff --git a/src/ripple/unity/types.cpp b/src/ripple/unity/types.cpp index 9f5cd07cc..2bc4033fe 100644 --- a/src/ripple/unity/types.cpp +++ b/src/ripple/unity/types.cpp @@ -35,9 +35,6 @@ #include #include -#include -#include -#include #include #include diff --git a/src/ripple/unity/types.h b/src/ripple/unity/types.h index ee11faae5..9548f2ca7 100644 --- a/src/ripple/unity/types.h +++ b/src/ripple/unity/types.h @@ -26,7 +26,6 @@ #include #include -#include // For ByteOrder #if BEAST_WIN32 diff --git a/src/ripple/unity/validators.cpp b/src/ripple/unity/validators.cpp index c7ad1e612..2884a4eea 100644 --- a/src/ripple/unity/validators.cpp +++ b/src/ripple/unity/validators.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include diff --git a/src/ripple/validators/impl/ChosenList.h b/src/ripple/validators/impl/ChosenList.h index ecf500b64..2de6bd0a0 100644 --- a/src/ripple/validators/impl/ChosenList.h +++ b/src/ripple/validators/impl/ChosenList.h @@ -37,8 +37,7 @@ public: } }; - typedef ripple::unordered_map > MapType; + typedef hardened_hash_map MapType; ChosenList (std::size_t expectedSize = 0) { diff --git a/src/ripple/validators/impl/Logic.h b/src/ripple/validators/impl/Logic.h index 4e653ed91..30d3cea15 100644 --- a/src/ripple/validators/impl/Logic.h +++ b/src/ripple/validators/impl/Logic.h @@ -21,7 +21,6 @@ #define RIPPLE_VALIDATORS_LOGIC_H_INCLUDED #include -#include namespace ripple { namespace Validators { @@ -68,9 +67,7 @@ public: // Holds the internal list of trusted validators // - typedef ripple::unordered_map < - RipplePublicKey, Validator, - beast::hardened_hash> ValidatorTable; + typedef hardened_hash_map ValidatorTable; ValidatorTable m_validators; // Filters duplicate validations diff --git a/src/ripple/validators/impl/Tuning.h b/src/ripple/validators/impl/Tuning.h index 00ad00fcf..3e8982eb9 100644 --- a/src/ripple/validators/impl/Tuning.h +++ b/src/ripple/validators/impl/Tuning.h @@ -67,8 +67,7 @@ template ContainerType; + typedef hash_map ContainerType; typedef typename ContainerType::iterator iterator; public: diff --git a/src/ripple/validators/impl/Validator.h b/src/ripple/validators/impl/Validator.h index 0e45cd21c..2f416d716 100644 --- a/src/ripple/validators/impl/Validator.h +++ b/src/ripple/validators/impl/Validator.h @@ -42,9 +42,8 @@ private: /** Holds the state of all recent ledgers for this validator. */ /** @{ */ - typedef CycledMap , - RippleLedgerHash::key_equal> LedgerMap; + typedef CycledMap , + RippleLedgerHash::key_equal> LedgerMap; LedgerMap m_ledgers; /** @} */