rippled
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
ripple::InboundTransactionsImp Class Reference
Inheritance diagram for ripple::InboundTransactionsImp:
Inheritance graph
[legend]
Collaboration diagram for ripple::InboundTransactionsImp:
Collaboration graph
[legend]

Public Types

using clock_type = beast::abstract_clock< std::chrono::steady_clock >
 

Public Member Functions

 InboundTransactionsImp (Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet, std::unique_ptr< PeerSetBuilder > peerSetBuilder)
 
TransactionAcquire::pointer getAcquire (uint256 const &hash)
 
std::shared_ptr< SHAMapgetSet (uint256 const &hash, bool acquire) override
 Find and return a transaction set, or nullptr if it is missing. More...
 
void gotData (LedgerHash const &hash, std::shared_ptr< Peer > peer, std::shared_ptr< protocol::TMLedgerData > packet_ptr) override
 We received a TMLedgerData from a peer. More...
 
void giveSet (uint256 const &hash, std::shared_ptr< SHAMap > const &set, bool fromAcquire) override
 Add a transaction set. More...
 
void newRound (std::uint32_t seq) override
 Informs the container if a new consensus round. More...
 
void stop () override
 

Private Types

using MapType = hash_map< uint256, InboundTransactionSet >
 

Private Attributes

Applicationapp_
 
std::recursive_mutex mLock
 
bool stopping_ {false}
 
MapType m_map
 
std::uint32_t m_seq
 
InboundTransactionSetm_zeroSet
 
std::function< void(std::shared_ptr< SHAMap > const &, bool)> m_gotSet
 
std::unique_ptr< PeerSetBuilderm_peerSetBuilder
 
beast::Journal j_
 

Detailed Description

Definition at line 61 of file InboundTransactions.cpp.

Member Typedef Documentation

◆ MapType

Definition at line 244 of file InboundTransactions.cpp.

◆ clock_type

Definition at line 38 of file InboundTransactions.h.

Constructor & Destructor Documentation

◆ InboundTransactionsImp()

ripple::InboundTransactionsImp::InboundTransactionsImp ( Application app,
beast::insight::Collector::ptr const &  collector,
std::function< void(std::shared_ptr< SHAMap > const &, bool)>  gotSet,
std::unique_ptr< PeerSetBuilder peerSetBuilder 
)

Definition at line 64 of file InboundTransactions.cpp.

Member Function Documentation

◆ getAcquire()

TransactionAcquire::pointer ripple::InboundTransactionsImp::getAcquire ( uint256 const &  hash)

Definition at line 82 of file InboundTransactions.cpp.

◆ getSet()

std::shared_ptr<SHAMap> ripple::InboundTransactionsImp::getSet ( uint256 const &  setHash,
bool  acquire 
)
overridevirtual

Find and return a transaction set, or nullptr if it is missing.

Parameters
setHashThe transaction set ID (digest of the SHAMap root node).
acquireWhether to fetch the transaction set from the network if it is missing.
Returns
The transaction set with ID setHash, or nullptr if it is missing.

Implements ripple::InboundTransactions.

Definition at line 96 of file InboundTransactions.cpp.

◆ gotData()

void ripple::InboundTransactionsImp::gotData ( LedgerHash const &  hash,
std::shared_ptr< Peer peer,
std::shared_ptr< protocol::TMLedgerData >  packet_ptr 
)
overridevirtual

We received a TMLedgerData from a peer.

Implements ripple::InboundTransactions.

Definition at line 135 of file InboundTransactions.cpp.

◆ giveSet()

void ripple::InboundTransactionsImp::giveSet ( uint256 const &  setHash,
std::shared_ptr< SHAMap > const &  set,
bool  acquired 
)
overridevirtual

Add a transaction set.

Parameters
setHashThe transaction set ID (should match set.getHash()).
setThe transaction set.
acquiredWhether this transaction set was acquired from a peer, or constructed by ourself during consensus.

Implements ripple::InboundTransactions.

Definition at line 180 of file InboundTransactions.cpp.

◆ newRound()

void ripple::InboundTransactionsImp::newRound ( std::uint32_t  seq)
overridevirtual

Informs the container if a new consensus round.

Implements ripple::InboundTransactions.

Definition at line 208 of file InboundTransactions.cpp.

◆ stop()

void ripple::InboundTransactionsImp::stop ( )
overridevirtual

Implements ripple::InboundTransactions.

Definition at line 236 of file InboundTransactions.cpp.

Member Data Documentation

◆ app_

Application& ripple::InboundTransactionsImp::app_
private

Definition at line 246 of file InboundTransactions.cpp.

◆ mLock

std::recursive_mutex ripple::InboundTransactionsImp::mLock
private

Definition at line 248 of file InboundTransactions.cpp.

◆ stopping_

bool ripple::InboundTransactionsImp::stopping_ {false}
private

Definition at line 250 of file InboundTransactions.cpp.

◆ m_map

MapType ripple::InboundTransactionsImp::m_map
private

Definition at line 251 of file InboundTransactions.cpp.

◆ m_seq

std::uint32_t ripple::InboundTransactionsImp::m_seq
private

Definition at line 252 of file InboundTransactions.cpp.

◆ m_zeroSet

InboundTransactionSet& ripple::InboundTransactionsImp::m_zeroSet
private

Definition at line 255 of file InboundTransactions.cpp.

◆ m_gotSet

std::function<void(std::shared_ptr<SHAMap> const&, bool)> ripple::InboundTransactionsImp::m_gotSet
private

Definition at line 257 of file InboundTransactions.cpp.

◆ m_peerSetBuilder

std::unique_ptr<PeerSetBuilder> ripple::InboundTransactionsImp::m_peerSetBuilder
private

Definition at line 259 of file InboundTransactions.cpp.

◆ j_

beast::Journal ripple::InboundTransactionsImp::j_
private

Definition at line 261 of file InboundTransactions.cpp.