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 init(int numPeers)
Start the SkipListAcquire task.
void addDataCallback(OnSkipListDataCB &&cb)
Add a callback that will be called when the skipList is ready or failed.
std::function< void(bool successful, uint256 const &hash)> OnSkipListDataCB
A callback used to notify that the SkipList is ready or failed.
InboundLedgers & inboundLedgers_
std::shared_ptr< SkipListData const > getData() const
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
void notify(ScopedLockType &sl)
Call the OnSkipListDataCB callbacks.
void retrieveSkipList(std::shared_ptr< Ledger const > const &ledger, ScopedLockType &sl)
Retrieve the skip list from the ledger.
void trigger(std::size_t limit, ScopedLockType &sl)
Trigger another round.
std::shared_ptr< SkipListData const > data_
void processData(std::uint32_t ledgerSeq, boost::intrusive_ptr< SHAMapItem const > const &item)
Process the data extracted from a peer's reply.
void onSkipListAcquired(std::vector< uint256 > const &skipList, std::uint32_t ledgerSeq, ScopedLockType &sl)
Process the skip list.
std::vector< OnSkipListDataCB > dataReadyCallbacks_
std::unique_ptr< PeerSet > peerSet_
~SkipListAcquire() override
std::uint32_t noFeaturePeerCount_
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.
SkipListData(std::uint32_t const ledgerSeq, std::vector< ripple::uint256 > const &skipList)
std::uint32_t const ledgerSeq
std::vector< ripple::uint256 > const skipList