rippled
Loading...
Searching...
No Matches
TransactionAcquire.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_APP_LEDGER_TRANSACTIONACQUIRE_H_INCLUDED
21#define RIPPLE_APP_LEDGER_TRANSACTIONACQUIRE_H_INCLUDED
22
23#include <xrpld/overlay/PeerSet.h>
24#include <xrpld/shamap/SHAMap.h>
25
26namespace ripple {
27
28// VFALCO TODO rename to PeerTxRequest
29// A transaction set we are trying to acquire
31 : public TimeoutCounter,
32 public std::enable_shared_from_this<TransactionAcquire>,
33 public CountedObject<TransactionAcquire>
34{
35public:
37
39 Application& app,
40 uint256 const& hash,
43
48
49 void
50 init(int startPeers);
51
52 void
53 stillNeed();
54
55private:
59
60 void
61 onTimer(bool progress, ScopedLockType& peerSetLock) override;
62
63 void
64 done();
65
66 void
67 addPeers(std::size_t limit);
68
69 void
72 pmDowncast() override;
73};
74
75} // namespace ripple
76
77#endif
Tracks the number of instances of an object.
This class is an "active" object.
void onTimer(bool progress, ScopedLockType &peerSetLock) override
Hook called from invokeOnTimer().
void trigger(std::shared_ptr< Peer > const &)
std::shared_ptr< SHAMap > mMap
std::weak_ptr< TimeoutCounter > pmDowncast() override
Return a weak pointer to this.
void addPeers(std::size_t limit)
std::unique_ptr< PeerSet > mPeerSet
SHAMapAddNode takeNodes(std::vector< std::pair< SHAMapNodeID, Slice > > const &data, std::shared_ptr< Peer > const &)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25