retry IRC if name in use,

resize to fit ubuntu's giant default font, 
scroll debug.log, 
pause gen during initial block download
This commit is contained in:
s_nakamoto
2009-12-11 16:49:21 +00:00
parent ba0909e96a
commit 0bbbee96b7
13 changed files with 187 additions and 89 deletions

View File

@@ -2530,7 +2530,7 @@ void BitcoinMiner()
//
// Search
//
unsigned int nStart = GetTime();
int64 nStart = GetTime();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
uint256 hash;
loop
@@ -2582,14 +2582,27 @@ void BitcoinMiner()
return;
if (fLimitProcessors && vnThreadsRunning[3] > nLimitProcessors)
return;
if (tmp.block.nNonce == 0)
if (vNodes.empty())
break;
if (pindexPrev != pindexBest)
if (tmp.block.nNonce == 0)
break;
if (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 60)
break;
if (vNodes.empty())
if (pindexPrev != pindexBest)
{
// Pause generating during initial download
if (GetTime() - nStart < 20)
{
CBlockIndex* pindexTmp;
do
{
pindexTmp = pindexBest;
Sleep(10000);
}
while (pindexTmp != pindexBest);
}
break;
}
tmp.block.nTime = pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
}
}