3#include <xrpld/app/ledger/InboundLedger.h>
4#include <xrpld/app/ledger/detail/TimeoutCounter.h>
6#include <xrpl/basics/CountedObject.h>
7#include <xrpl/basics/base_uint.h>
8#include <xrpl/ledger/Ledger.h>
Manages the lifetime of inbound ledgers.
std::uint32_t const ledgerSeq_
void trigger(std::size_t limit, ScopedLockType &sl)
Trigger another round.
void init(int numPeers)
Start the LedgerDeltaAcquire task.
std::shared_ptr< Ledger const > fullLedger_
std::uint32_t noFeaturePeerCount_
void onLedgerBuilt(ScopedLockType &sl, std::optional< InboundLedger::Reason > reason={})
Process a newly built ledger, such as store it.
LedgerDeltaAcquire(Application &app, InboundLedgers &inboundLedgers, uint256 const &ledgerHash, std::uint32_t ledgerSeq, std::unique_ptr< PeerSet > peerSet)
Constructor.
InboundLedgers & inboundLedgers_
std::vector< OnDeltaDataCB > dataReadyCallbacks_
~LedgerDeltaAcquire() override
void processData(LedgerHeader const &info, std::map< std::uint32_t, std::shared_ptr< STTx const > > &&orderedTxns)
Process the data extracted from a peer's reply.
std::unique_ptr< PeerSet > peerSet_
std::set< InboundLedger::Reason > reasons_
void notify(ScopedLockType &sl)
Call the OnDeltaDataCB callbacks.
std::shared_ptr< Ledger const > replayTemp_
friend class LedgerReplayTask
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
std::shared_ptr< Ledger const > tryBuild(std::shared_ptr< Ledger const > const &parent)
Try to build the ledger if not already.
std::map< std::uint32_t, std::shared_ptr< STTx const > > orderedTxns_
void addDataCallback(InboundLedger::Reason reason, OnDeltaDataCB &&cb)
Add a reason and a callback to the LedgerDeltaAcquire subtask.
std::function< void(bool successful, uint256 const &hash)> OnDeltaDataCB
A callback used to notify that the delta's data is ready or failed.
Supports data retrieval by managing a set of peers.
TimeoutCounter(Application &app, uint256 const &targetHash, std::chrono::milliseconds timeoutInterval, QueueJobParameter &&jobParameter, beast::Journal journal)
std::unique_lock< std::recursive_mutex > ScopedLockType
Ledger replay client side.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.