Emergency patch to fix ledger not closing.

Do not timeout on acquiring a transaction set if a trusted peer
still proposes it. Instead, fetch more aggressively.
This commit is contained in:
JoelKatz
2013-04-05 09:41:43 -07:00
parent f37737edd3
commit 7131564eb1
5 changed files with 40 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ TransactionAcquire::TransactionAcquire(const uint256& hash) : PeerSet(hash, TX_A
void TransactionAcquire::done()
{
boost::recursive_mutex::scoped_lock sl(theApp->getMasterLock());
if (mFailed)
{
cLog(lsWARNING) << "Failed to acquire TX set " << mHash;
@@ -45,14 +46,27 @@ void TransactionAcquire::done()
void TransactionAcquire::onTimer(bool progress)
{
bool aggressive = false;
if (getTimeouts() > 10)
{
cLog(lsWARNING) << "Giving up on TX set " << getHash();
mFailed = true;
done();
return;
cLog(lsWARNING) << "Ten timeouts on TX set " << getHash();
{
boost::recursive_mutex::scoped_lock sl(theApp->getMasterLock());
if (theApp->getOPs().stillNeedTXSet(mHash))
{
cLog(lsWARNING) << "Still need it";
mTimeouts = 0;
aggressive = true;
}
}
if (!aggressive)
{
mFailed = true;
done();
return;
}
}
if (!getPeerCount())
if (aggressive || !getPeerCount())
{ // out of peers
cLog(lsWARNING) << "Out of peers for TX set " << getHash();