mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Refactoring of container usage:
* New ripple container aliases use hardened_hash * Use std::tuple instead of boost::tuple * Use std unordered containers instead of boost * Fix Destroyer for new containers * Fix warning for fnv1a on 32-bit arch * Validator fixes for new containers
This commit is contained in:
committed by
Vinnie Falco
parent
6f8145b696
commit
6596c94eb9
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
|
||||
|
||||
#include "../../common/UnorderedMap.h"
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
@@ -35,7 +37,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
typedef boost::unordered_map <RipplePublicKey, Info, RipplePublicKey::hasher> MapType;
|
||||
typedef ripple::unordered_map <RipplePublicKey, Info,
|
||||
beast::hardened_hash<RipplePublicKey>> MapType;
|
||||
|
||||
ChosenList (std::size_t expectedSize = 0)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define RIPPLE_VALIDATORS_LOGIC_H_INCLUDED
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
@@ -67,9 +68,9 @@ public:
|
||||
|
||||
// Holds the internal list of trusted validators
|
||||
//
|
||||
typedef boost::unordered_map <
|
||||
typedef ripple::unordered_map <
|
||||
RipplePublicKey, Validator,
|
||||
RipplePublicKey::hasher> ValidatorTable;
|
||||
beast::hardened_hash<RipplePublicKey>> ValidatorTable;
|
||||
ValidatorTable m_validators;
|
||||
|
||||
// Filters duplicate validations
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_VALIDATORS_TUNING_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_TUNING_H_INCLUDED
|
||||
|
||||
#include "../../common/UnorderedMap.h"
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
namespace ripple {
|
||||
@@ -61,11 +63,11 @@ template <class Key,
|
||||
class Info, // per-container info
|
||||
class Hash = typename Key::hasher,
|
||||
class KeyEqual = std::equal_to <Key>,
|
||||
class Allocator = std::allocator <Key> >
|
||||
class Allocator = std::allocator <std::pair <Key const, T> > >
|
||||
class CycledMap
|
||||
{
|
||||
private:
|
||||
typedef boost::unordered_map <
|
||||
typedef ripple::unordered_map <
|
||||
Key, T, Hash, KeyEqual, Allocator> ContainerType;
|
||||
typedef typename ContainerType::iterator iterator;
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ private:
|
||||
/** Holds the state of all recent ledgers for this validator. */
|
||||
/** @{ */
|
||||
typedef CycledMap <RippleLedgerHash, Ledger, Count,
|
||||
RippleLedgerHash::hasher, RippleLedgerHash::key_equal> LedgerMap;
|
||||
beast::hardened_hash<RippleLedgerHash>,
|
||||
RippleLedgerHash::key_equal> LedgerMap;
|
||||
LedgerMap m_ledgers;
|
||||
/** @} */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user