20 #ifndef RIPPLE_APP_LEDGER_SKIPLISTACQUIRE_H_INCLUDED
21 #define RIPPLE_APP_LEDGER_SKIPLISTACQUIRE_H_INCLUDED
23 #include <ripple/app/ledger/InboundLedger.h>
24 #include <ripple/app/ledger/Ledger.h>
25 #include <ripple/app/ledger/impl/TimeoutCounter.h>
26 #include <ripple/app/main/Application.h>
27 #include <ripple/shamap/SHAMap.h>
34 class LedgerReplayClient;
99 boost::intrusive_ptr<SHAMapItem const>
const& item);
~SkipListAcquire() override
SkipListData(std::uint32_t const ledgerSeq, std::vector< ripple::uint256 > const &skipList)
std::unique_lock< std::recursive_mutex > ScopedLockType
Tracks the number of instances of an object.
void retrieveSkipList(std::shared_ptr< Ledger const > const &ledger, ScopedLockType &sl)
Retrieve the skip list from the ledger.
InboundLedgers & inboundLedgers_
void trigger(std::size_t limit, ScopedLockType &sl)
Trigger another round.
SkipListAcquire(Application &app, InboundLedgers &inboundLedgers, uint256 const &ledgerHash, std::unique_ptr< PeerSet > peerSet)
Constructor.
std::uint32_t noFeaturePeerCount_
void onSkipListAcquired(std::vector< uint256 > const &skipList, std::uint32_t ledgerSeq, ScopedLockType &sl)
Process the skip list.
const std::uint32_t ledgerSeq
This class is an "active" object.
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
void init(int numPeers)
Start the SkipListAcquire task.
Manage the retrieval of a skip list in a ledger from the network.
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
Ledger replay client side.
std::vector< OnSkipListDataCB > dataReadyCallbacks_
Manages the lifetime of inbound ledgers.
const std::vector< ripple::uint256 > skipList
std::function< void(bool successful, uint256 const &hash)> OnSkipListDataCB
A callback used to notify that the SkipList is ready or failed.
std::shared_ptr< SkipListData const > data_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::unique_ptr< PeerSet > peerSet_
void addDataCallback(OnSkipListDataCB &&cb)
Add a callback that will be called when the skipList is ready or failed.
void notify(ScopedLockType &sl)
Call the OnSkipListDataCB callbacks.
void processData(std::uint32_t ledgerSeq, boost::intrusive_ptr< SHAMapItem const > const &item)
Process the data extracted from a peer's reply.
std::shared_ptr< SkipListData const > getData() const