20 #ifndef RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED
21 #define RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED
23 #include <ripple/app/main/Application.h>
24 #include <ripple/app/ledger/Ledger.h>
25 #include <ripple/overlay/PeerSet.h>
26 #include <ripple/basics/CountedObject.h>
std::set< uint256 > mRecentNodes
std::vector< neededHash_t > getNeededHashes()
Json::Value getJson(int)
Return a Json::objectValue.
Tracks the number of instances of an object.
std::uint32_t getSeq() const
An immutable linear range of bytes.
std::shared_ptr< Ledger const > getLedger() const
void update(std::uint32_t seq)
InboundLedger(Application &app, uint256 const &hash, std::uint32_t seq, Reason reason, clock_type &)
void newPeer(std::shared_ptr< Peer > const &peer) override
void filterNodes(std::vector< std::pair< SHAMapNodeID, uint256 >> &nodes, TriggerReason reason)
int processData(std::shared_ptr< Peer > peer, protocol::TMLedgerData &data)
Process one TMLedgerData Returns the number of useful nodes.
std::vector< uint256 > neededStateHashes(int max, SHAMapSyncFilter *filter) const
beast::abstract_clock< std::chrono::steady_clock > clock_type
std::pair< std::weak_ptr< Peer >, std::shared_ptr< protocol::TMLedgerData > > PeerDataPairType
std::vector< uint256 > neededTxHashes(int max, SHAMapSyncFilter *filter) const
bool takeHeader(std::string const &data)
Take ledger header data Call with a lock.
bool gotData(std::weak_ptr< Peer >, std::shared_ptr< protocol::TMLedgerData > const &)
Stash a TMLedgerData received from a peer for later processing Returns 'true' if we need to dispatch.
bool takeTxNode(const std::vector< SHAMapNodeID > &IDs, const std::vector< Blob > &data, SHAMapAddNode &)
Process TX data received from a peer Call with a lock.
std::shared_ptr< Ledger > mLedger
static LedgerInfo deserializeHeader(Slice data, bool hasPrefix)
void addPeers()
Add more peers to the set, if possible.
std::pair< protocol::TMGetObjectByHash::ObjectType, uint256 > neededHash_t
bool takeTxRootNode(Slice const &data, SHAMapAddNode &)
Process AS root node received from a peer Call with a lock.
std::weak_ptr< PeerSet > pmDowncast() override
static char const * getCountedObjectName()
std::unique_lock< std::recursive_mutex > ScopedLockType
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool takeAsRootNode(Slice const &data, SHAMapAddNode &)
Process AS root node received from a peer Call with a lock.
Supports data retrieval by managing a set of peers.
bool takeAsNode(const std::vector< SHAMapNodeID > &IDs, const std::vector< Blob > &data, SHAMapAddNode &)
Process AS data received from a peer Call with a lock.
void trigger(std::shared_ptr< Peer > const &, TriggerReason)
Request more nodes, perhaps from a specific peer.
Information about the notional ledger backing the view.
void runData()
Process pending TMLedgerData Query the 'best' peer.
std::vector< PeerDataPairType > mReceivedData
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Called with a lock by the PeerSet when the timer expires.
std::mutex mReceivedDataLock
void init(ScopedLockType &collectionLock)
void progress()
Called to indicate that forward progress has been made.