X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Faddrman.cpp;h=f24e7e78202c89d64b4a6354ce6ebd65e2832215;hb=2404891de8ac5b357d0abde90f2e286a3153fdef;hp=6676f62a5c1e0ae26e6d38b2bd8c0b6aad639bbf;hpb=e1fc548ff893f35d24565b381eca454ba6319ef4;p=novacoin.git diff --git a/src/addrman.cpp b/src/addrman.cpp index 6676f62..f24e7e7 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -43,13 +43,13 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const if (nTime > nNow + 10*60) // came in a flying DeLorean return true; - if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*86400) // not seen in over a month + if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*nOneDay) // not seen in over a month return true; if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried three times and never a success return true; - if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*86400 && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week + if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*nOneDay && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week return true; return false; @@ -398,7 +398,7 @@ CAddress CAddrMan::Select_(int nUnkBias) { // use a tried node double fChanceFactor = 1.0; - while(1) + for ( ; ; ) { int nKBucket = GetRandInt(vvTried.size()); std::vector &vTried = vvTried[nKBucket]; @@ -413,7 +413,7 @@ CAddress CAddrMan::Select_(int nUnkBias) } else { // use a new node double fChanceFactor = 1.0; - while(1) + for ( ; ; ) { int nUBucket = GetRandInt(vvNew.size()); std::set &vNew = vvNew[nUBucket];