rippled
Loading...
Searching...
No Matches
InboundTransactions.h
1#pragma once
2
3#include <xrpld/overlay/Peer.h>
4
5#include <xrpl/beast/clock/abstract_clock.h>
6#include <xrpl/shamap/SHAMap.h>
7
8#include <memory>
9
10namespace xrpl {
11
12class Application;
13
18{
19public:
21
26
27 virtual ~InboundTransactions() = 0;
28
38 getSet(uint256 const& setHash, bool acquire) = 0;
39
46 virtual void
48
56 virtual void
57 giveSet(uint256 const& setHash, std::shared_ptr<SHAMap> const& set, bool acquired) = 0;
58
61 virtual void
63
64 virtual void
65 stop() = 0;
66};
67
70 Application& app,
71 beast::insight::Collector::ptr const& collector,
72 std::function<void(std::shared_ptr<SHAMap> const&, bool)> gotSet);
73
74} // namespace xrpl
Manages the acquisition and lifetime of transaction sets.
InboundTransactions(InboundTransactions const &)=delete
virtual ~InboundTransactions()=0
virtual void newRound(std::uint32_t seq)=0
Informs the container if a new consensus round.
virtual std::shared_ptr< SHAMap > getSet(uint256 const &setHash, bool acquire)=0
Find and return a transaction set, or nullptr if it is missing.
virtual void gotData(uint256 const &setHash, std::shared_ptr< Peer > peer, std::shared_ptr< protocol::TMLedgerData > message)=0
Add a transaction set from a LedgerData message.
virtual void giveSet(uint256 const &setHash, std::shared_ptr< SHAMap > const &set, bool acquired)=0
Add a transaction set.
InboundTransactions & operator=(InboundTransactions const &)=delete
virtual void stop()=0
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)