rippled
Classes | Public Types | Public Member Functions | Private Attributes | Friends | List of all members
ripple::RCLCensorshipDetector< TxID, Sequence > Class Template Reference
Collaboration diagram for ripple::RCLCensorshipDetector< TxID, Sequence >:
Collaboration graph
[legend]

Classes

struct  TxIDSeq
 

Public Types

using TxIDSeqVec = std::vector< TxIDSeq >
 

Public Member Functions

 RCLCensorshipDetector ()=default
 
void propose (TxIDSeqVec proposed)
 Add transactions being proposed for the current consensus round. More...
 
template<class Predicate >
void check (std::vector< TxID > accepted, Predicate &&pred)
 Determine which transactions made it and perform censorship detection. More...
 
void reset ()
 Removes all elements from the tracker. More...
 

Private Attributes

TxIDSeqVec tracker_
 

Friends

bool operator< (TxIDSeq const &lhs, TxIDSeq const &rhs)
 
bool operator< (TxIDSeq const &lhs, TxID const &rhs)
 
bool operator< (TxID const &lhs, TxIDSeq const &rhs)
 

Detailed Description

template<class TxID, class Sequence>
class ripple::RCLCensorshipDetector< TxID, Sequence >

Definition at line 32 of file RCLCensorshipDetector.h.

Member Typedef Documentation

◆ TxIDSeqVec

template<class TxID , class Sequence >
using ripple::RCLCensorshipDetector< TxID, Sequence >::TxIDSeqVec = std::vector<TxIDSeq>

Definition at line 66 of file RCLCensorshipDetector.h.

Constructor & Destructor Documentation

◆ RCLCensorshipDetector()

template<class TxID , class Sequence >
ripple::RCLCensorshipDetector< TxID, Sequence >::RCLCensorshipDetector ( )
default

Member Function Documentation

◆ propose()

template<class TxID , class Sequence >
void ripple::RCLCensorshipDetector< TxID, Sequence >::propose ( TxIDSeqVec  proposed)

Add transactions being proposed for the current consensus round.

Parameters
proposedThe set of transactions that we are initially proposing for this round.

Definition at line 80 of file RCLCensorshipDetector.h.

◆ check()

template<class TxID , class Sequence >
template<class Predicate >
void ripple::RCLCensorshipDetector< TxID, Sequence >::check ( std::vector< TxID accepted,
Predicate &&  pred 
)

Determine which transactions made it and perform censorship detection.

This function is called when the server is proposing and a consensus round it participated in completed.

Parameters
acceptedThe set of transactions that the network agreed should be included in the ledger being built.
predA predicate invoked for every transaction we've proposed but which hasn't yet made it. The predicate must be callable as: bool pred(TxID const&, Sequence) It must return true for entries that should be removed.

Definition at line 112 of file RCLCensorshipDetector.h.

◆ reset()

template<class TxID , class Sequence >
void ripple::RCLCensorshipDetector< TxID, Sequence >::reset ( )

Removes all elements from the tracker.

Typically, this function might be called after we reconnect to the network following an outage, or after we start tracking the network.

Definition at line 137 of file RCLCensorshipDetector.h.

Friends And Related Function Documentation

◆ operator< [1/3]

template<class TxID , class Sequence >
bool operator< ( TxIDSeq const &  lhs,
TxIDSeq const &  rhs 
)
friend

Definition at line 47 of file RCLCensorshipDetector.h.

◆ operator< [2/3]

template<class TxID , class Sequence >
bool operator< ( TxIDSeq const &  lhs,
TxID const &  rhs 
)
friend

Definition at line 55 of file RCLCensorshipDetector.h.

◆ operator< [3/3]

template<class TxID , class Sequence >
bool operator< ( TxID const &  lhs,
TxIDSeq const &  rhs 
)
friend

Definition at line 61 of file RCLCensorshipDetector.h.

Member Data Documentation

◆ tracker_

template<class TxID , class Sequence >
TxIDSeqVec ripple::RCLCensorshipDetector< TxID, Sequence >::tracker_
private

Definition at line 69 of file RCLCensorshipDetector.h.