mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add virtual destructor. Add TransactionAcquire code.
This commit is contained in:
@@ -25,6 +25,7 @@ protected:
|
||||
std::list< boost::weak_ptr<Peer> > mPeers;
|
||||
|
||||
PeerSet(const uint256& hash, int interval);
|
||||
virtual ~PeerSet() { ; }
|
||||
|
||||
public:
|
||||
const uint256& getHash() const { return mHash; }
|
||||
@@ -85,6 +86,29 @@ public:
|
||||
Peer::pointer);
|
||||
};
|
||||
|
||||
class TransactionAcquire : public PeerSet, public boost::enable_shared_from_this<TransactionAcquire>
|
||||
{ // A transaction set we are trying to acquire
|
||||
public:
|
||||
typedef boost::shared_ptr<TransactionAcquire> pointer;
|
||||
|
||||
protected:
|
||||
SHAMap::pointer mMap;
|
||||
|
||||
void onTimer() { trigger(Peer::pointer()); }
|
||||
void newPeer(Peer::pointer peer) { trigger(peer); }
|
||||
|
||||
void done();
|
||||
void trigger(Peer::pointer);
|
||||
boost::weak_ptr<PeerSet> pmDowncast();
|
||||
|
||||
public:
|
||||
TransactionAcquire(const uint256& hash);
|
||||
SHAMap::pointer getMap();
|
||||
|
||||
bool takeNode(const std::list<SHAMapNode>& IDs, const std::list<std::vector<unsigned char> >& data,
|
||||
Peer::pointer);
|
||||
};
|
||||
|
||||
class LedgerAcquireMaster
|
||||
{
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user