1#ifndef XRPL_APP_LEDGER_SKIPLISTACQUIRE_H_INCLUDED
2#define XRPL_APP_LEDGER_SKIPLISTACQUIRE_H_INCLUDED
4#include <xrpld/app/ledger/InboundLedger.h>
5#include <xrpld/app/ledger/Ledger.h>
6#include <xrpld/app/ledger/detail/TimeoutCounter.h>
7#include <xrpld/app/main/Application.h>
9#include <xrpl/shamap/SHAMap.h>
15class LedgerReplayClient;
80 boost::intrusive_ptr<SHAMapItem const>
const& item);
Tracks the number of instances of an object.
Manages the lifetime of inbound ledgers.
Manage the retrieval of a skip list in a ledger from the network.
void addDataCallback(OnSkipListDataCB &&cb)
Add a callback that will be called when the skipList is ready or failed.
std::uint32_t noFeaturePeerCount_
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
std::unique_ptr< PeerSet > peerSet_
std::shared_ptr< SkipListData const > data_
void trigger(std::size_t limit, ScopedLockType &sl)
Trigger another round.
void notify(ScopedLockType &sl)
Call the OnSkipListDataCB callbacks.
std::vector< OnSkipListDataCB > dataReadyCallbacks_
std::shared_ptr< SkipListData const > getData() const
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
InboundLedgers & inboundLedgers_
~SkipListAcquire() override
std::function< void(bool successful, uint256 const &hash)> OnSkipListDataCB
A callback used to notify that the SkipList is ready or failed.
void onSkipListAcquired(std::vector< uint256 > const &skipList, std::uint32_t ledgerSeq, ScopedLockType &sl)
Process the skip list.
void retrieveSkipList(std::shared_ptr< Ledger const > const &ledger, ScopedLockType &sl)
Retrieve the skip list from the ledger.
void processData(std::uint32_t ledgerSeq, boost::intrusive_ptr< SHAMapItem const > const &item)
Process the data extracted from a peer's reply.
void init(int numPeers)
Start the SkipListAcquire task.
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.
std::vector< xrpl::uint256 > const skipList
std::uint32_t const ledgerSeq
SkipListData(std::uint32_t const ledgerSeq, std::vector< xrpl::uint256 > const &skipList)