1#ifndef XRPL_APP_LEDGER_LEDGERDELTAACQUIRE_H_INCLUDED
2#define XRPL_APP_LEDGER_LEDGERDELTAACQUIRE_H_INCLUDED
4#include <xrpld/app/ledger/InboundLedger.h>
5#include <xrpld/app/ledger/Ledger.h>
6#include <xrpld/app/ledger/detail/TimeoutCounter.h>
8#include <xrpl/basics/CountedObject.h>
9#include <xrpl/basics/base_uint.h>
17class LedgerReplayClient;
Tracks the number of instances of an object.
Manages the lifetime of inbound ledgers.
Manage the retrieval of a ledger delta (header and transactions) from the network.
std::shared_ptr< Ledger const > fullLedger_
void trigger(std::size_t limit, ScopedLockType &sl)
Trigger another round.
std::set< InboundLedger::Reason > reasons_
void processData(LedgerInfo const &info, std::map< std::uint32_t, std::shared_ptr< STTx const > > &&orderedTxns)
Process the data extracted from a peer's reply.
std::uint32_t noFeaturePeerCount
std::map< std::uint32_t, std::shared_ptr< STTx const > > orderedTxns_
std::shared_ptr< Ledger const > tryBuild(std::shared_ptr< Ledger const > const &parent)
Try to build the ledger if not already.
std::shared_ptr< Ledger const > replayTemp_
InboundLedgers & inboundLedgers_
std::uint32_t const ledgerSeq_
void init(int numPeers)
Start the LedgerDeltaAcquire task.
std::vector< OnDeltaDataCB > dataReadyCallbacks_
~LedgerDeltaAcquire() override
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
std::unique_ptr< PeerSet > peerSet_
void notify(ScopedLockType &sl)
Call the OnDeltaDataCB callbacks.
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
void addDataCallback(InboundLedger::Reason reason, OnDeltaDataCB &&cb)
Add a reason and a callback to the LedgerDeltaAcquire subtask.
void onLedgerBuilt(ScopedLockType &sl, std::optional< InboundLedger::Reason > reason={})
Process a newly built ledger, such as store it.
This class is an "active" object.
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.