xrpld
Loading...
Searching...
No Matches
TransactionAcquire.h
1#pragma once
2
3#include <xrpld/app/ledger/detail/TimeoutCounter.h>
4#include <xrpld/overlay/PeerSet.h>
5
6#include <xrpl/shamap/SHAMap.h>
7
8namespace xrpl {
9
10// VFALCO TODO rename to PeerTxRequest
11// A transaction set we are trying to acquire
13 public std::enable_shared_from_this<TransactionAcquire>,
14 public CountedObject<TransactionAcquire>
15{
16public:
18
20 ~TransactionAcquire() override = default;
21
26
27 void
28 init(int startPeers);
29
30 void
31 stillNeed();
32
33private:
35 bool haveRoot_{false};
37
38 void
39 onTimer(bool progress, ScopedLockType& peerSetLock) override;
40
41 void
42 done();
43
44 void
45 addPeers(std::size_t limit);
46
47 void
50 pmDowncast() override;
51};
52
53} // namespace xrpl
TimeoutCounter(Application &app, uint256 const &targetHash, std::chrono::milliseconds timeoutInterval, QueueJobParameter &&jobParameter, beast::Journal journal)
std::unique_lock< std::recursive_mutex > ScopedLockType
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
std::shared_ptr< SHAMap > map_
void addPeers(std::size_t limit)
std::shared_ptr< TransactionAcquire > pointer
void trigger(std::shared_ptr< Peer > const &)
TransactionAcquire(Application &app, uint256 const &hash, std::unique_ptr< PeerSet > peerSet)
SHAMapAddNode takeNodes(std::vector< std::pair< SHAMapNodeID, Slice > > const &data, std::shared_ptr< Peer > const &)
~TransactionAcquire() override=default
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
std::unique_ptr< PeerSet > peerSet_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
BaseUInt< 256 > uint256
Definition base_uint.h:562