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/app/main/Application.h>
24#include <xrpld/overlay/PeerSet.h>
25#include <xrpld/shamap/SHAMap.h>
26
27namespace ripple {
28
29// VFALCO TODO rename to PeerTxRequest
30// A transaction set we are trying to acquire
32 : public TimeoutCounter,
33 public std::enable_shared_from_this<TransactionAcquire>,
34 public CountedObject<TransactionAcquire>
35{
36public:
38
40 Application& app,
41 uint256 const& hash,
44
49
50 void
51 init(int startPeers);
52
53 void
54 stillNeed();
55
56private:
60
61 void
62 onTimer(bool progress, ScopedLockType& peerSetLock) override;
63
64 void
65 done();
66
67 void
68 addPeers(std::size_t limit);
69
70 void
73 pmDowncast() override;
74};
75
76} // namespace ripple
77
78#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:26