Fix ledger acquire timing.

This commit is contained in:
JoelKatz
2012-05-10 17:44:06 -07:00
parent 6dc8d762e8
commit 02ce4acb11
3 changed files with 60 additions and 21 deletions

View File

@@ -31,10 +31,11 @@ protected:
std::list<boost::weak_ptr<Peer> > mPeers; // peers known to have this ledger
void done();
void trigger();
static void timerEntry(boost::weak_ptr<LedgerAcquire>, const boost::system::error_code&);
void sendRequest(boost::shared_ptr<newcoin::TMGetLedger> message);
void sendRequest(boost::shared_ptr<newcoin::TMGetLedger> message, Peer::pointer peer);
void trigger(Peer::pointer peer);
public:
LedgerAcquire(const uint256& hash);
@@ -51,9 +52,11 @@ public:
void peerHas(Peer::pointer);
void badPeer(Peer::pointer);
bool takeBase(const std::string& data);
bool takeTxNode(const std::list<SHAMapNode>& IDs, const std::list<std::vector<unsigned char> >& data);
bool takeAsNode(const std::list<SHAMapNode>& IDs, const std::list<std::vector<unsigned char> >& data);
bool takeBase(const std::string& data, Peer::pointer);
bool takeTxNode(const std::list<SHAMapNode>& IDs, const std::list<std::vector<unsigned char> >& data,
Peer::pointer);
bool takeAsNode(const std::list<SHAMapNode>& IDs, const std::list<std::vector<unsigned char> >& data,
Peer::pointer);
void resetTimer();
};
@@ -70,7 +73,7 @@ public:
LedgerAcquire::pointer find(const uint256& hash);
bool hasLedger(const uint256& ledgerHash);
bool dropLedger(const uint256& ledgerHash);
bool gotLedgerData(newcoin::TMLedgerData& packet);
bool gotLedgerData(newcoin::TMLedgerData& packet, Peer::pointer);
};
#endif