Fix an infinite timeout scenario with ledger acquisition.

This commit is contained in:
JoelKatz
2012-08-02 11:34:11 -07:00
parent 63576f0709
commit befd7aa108
2 changed files with 11 additions and 1 deletions

View File

@@ -95,6 +95,16 @@ LedgerAcquire::LedgerAcquire(const uint256& hash) : PeerSet(hash, LEDGER_ACQUIRE
#endif
}
void LedgerAcquire::onTimer()
{
if (getTimeouts() > 6)
{
setFailed();
done();
}
else trigger(Peer::pointer());
}
boost::weak_ptr<PeerSet> LedgerAcquire::pmDowncast()
{
return boost::shared_polymorphic_downcast<PeerSet, LedgerAcquire>(shared_from_this());