{
// use a tried node
double fChanceFactor = 1.0;
- while(1)
+ for ( ; ; )
{
int nKBucket = GetRandInt(vvTried.size());
std::vector<int> &vTried = vvTried[nKBucket];
} else {
// use a new node
double fChanceFactor = 1.0;
- while(1)
+ for ( ; ; )
{
int nUBucket = GetRandInt(vvNew.size());
std::set<int> &vNew = vvNew[nUBucket];
if (semOutbound)
for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++)
semOutbound->post();
- do
+ for ( ; ; )
{
int nThreadsRunning = 0;
for (int n = 0; n < THREAD_MAX; n++)
if (GetTime() - nStart > 20)
break;
Sleep(20);
- } while(true);
+ };
if (vnThreadsRunning[THREAD_SOCKETHANDLER] > 0) printf("ThreadSocketHandler still running\n");
if (vnThreadsRunning[THREAD_OPENCONNECTIONS] > 0) printf("ThreadOpenConnections still running\n");
if (vnThreadsRunning[THREAD_MESSAGEHANDLER] > 0) printf("ThreadMessageHandler still running\n");
intro.setDataDirectory(dataDir);
intro.setWindowIcon(QIcon(":icons/bitcoin"));
- while(true)
+ for ( ; ; )
{
if(!intro.exec())
{
{
nWalletUnlockTime = nMyWakeTime;
- do
+ for ( ; ; )
{
if (nWalletUnlockTime==0)
break;
Sleep(nToSleep);
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
- } while(1);
+ };
if (nWalletUnlockTime)
{
inline unsigned int GetSizeOfVarInt(I n)
{
int nRet = 0;
- while(true) {
+ for ( ; ; ) {
nRet++;
if (n <= 0x7F)
break;
{
unsigned char tmp[(sizeof(n)*8+6)/7];
int len=0;
- while(true) {
+ for ( ; ; ) {
tmp[len] = (n & 0x7F) | (len ? 0x80 : 0x00);
if (n <= 0x7F)
break;
I ReadVarInt(Stream& is)
{
I n = 0;
- while(true) {
+ for ( ; ; ) {
unsigned char chData;
READDATA(is, chData);
n = (n << 7) | (chData & 0x7F);