xrpld
Loading...
Searching...
No Matches
xrpl::InboundTransactionsImp Class Referenceabstract
Inheritance diagram for xrpl::InboundTransactionsImp:
Collaboration diagram for xrpl::InboundTransactionsImp:

Public Types

using clock_type = beast::AbstractClock<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.
void gotData (LedgerHash const &hash, std::shared_ptr< Peer > peer, std::shared_ptr< protocol::TMLedgerData > packetPtr) override
 We received a TMLedgerData from a peer.
void giveSet (uint256 const &hash, std::shared_ptr< SHAMap > const &set, bool fromAcquire) override
 Add a transaction set.
void newRound (std::uint32_t seq) override
 Informs the container if a new consensus round.
void stop () override
virtual void gotData (uint256 const &setHash, std::shared_ptr< Peer > peer, std::shared_ptr< protocol::TMLedgerData > message)=0
 Add a transaction set from a LedgerData message.

Private Types

using MapType = hash_map<uint256, InboundTransactionSet>

Private Attributes

Applicationapp_
std::recursive_mutex lock_
bool stopping_ {false}
MapType map_
std::uint32_t seq_ {0}
InboundTransactionSetzeroSet_
std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet_
std::unique_ptr< PeerSetBuilderpeerSetBuilder_
beast::Journal j_

Detailed Description

Definition at line 53 of file InboundTransactions.cpp.

Member Typedef Documentation

◆ MapType

◆ clock_type

Constructor & Destructor Documentation

◆ InboundTransactionsImp()

xrpl::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 56 of file InboundTransactions.cpp.

Member Function Documentation

◆ getAcquire()

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

Definition at line 73 of file InboundTransactions.cpp.

◆ getSet()

std::shared_ptr< SHAMap > xrpl::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 xrpl::InboundTransactions.

Definition at line 87 of file InboundTransactions.cpp.

◆ gotData() [1/2]

void xrpl::InboundTransactionsImp::gotData ( LedgerHash const & hash,
std::shared_ptr< Peer > peer,
std::shared_ptr< protocol::TMLedgerData > packetPtr )
override

We received a TMLedgerData from a peer.

Definition at line 125 of file InboundTransactions.cpp.

◆ giveSet()

void xrpl::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 xrpl::InboundTransactions.

Definition at line 170 of file InboundTransactions.cpp.

◆ newRound()

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

Informs the container if a new consensus round.

Implements xrpl::InboundTransactions.

Definition at line 198 of file InboundTransactions.cpp.

◆ stop()

void xrpl::InboundTransactionsImp::stop ( )
overridevirtual

Implements xrpl::InboundTransactions.

Definition at line 229 of file InboundTransactions.cpp.

◆ gotData() [2/2]

virtual void xrpl::InboundTransactions::gotData ( uint256 const & setHash,
std::shared_ptr< Peer > peer,
std::shared_ptr< protocol::TMLedgerData > message )
pure virtualinherited

Add a transaction set from a LedgerData message.

Parameters
setHashThe transaction set ID (digest of the SHAMap root node).
peerThe peer that sent the message.
messageThe LedgerData message.

Member Data Documentation

◆ app_

Application& xrpl::InboundTransactionsImp::app_
private

Definition at line 239 of file InboundTransactions.cpp.

◆ lock_

std::recursive_mutex xrpl::InboundTransactionsImp::lock_
private

Definition at line 241 of file InboundTransactions.cpp.

◆ stopping_

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

Definition at line 243 of file InboundTransactions.cpp.

◆ map_

MapType xrpl::InboundTransactionsImp::map_
private

Definition at line 244 of file InboundTransactions.cpp.

◆ seq_

std::uint32_t xrpl::InboundTransactionsImp::seq_ {0}
private

Definition at line 245 of file InboundTransactions.cpp.

◆ zeroSet_

InboundTransactionSet& xrpl::InboundTransactionsImp::zeroSet_
private

Definition at line 248 of file InboundTransactions.cpp.

◆ gotSet_

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

Definition at line 250 of file InboundTransactions.cpp.

◆ peerSetBuilder_

std::unique_ptr<PeerSetBuilder> xrpl::InboundTransactionsImp::peerSetBuilder_
private

Definition at line 252 of file InboundTransactions.cpp.

◆ j_

beast::Journal xrpl::InboundTransactionsImp::j_
private

Definition at line 254 of file InboundTransactions.cpp.