Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/db.cpp
Show All 29 Lines | void CAddrInfo::Update(bool good) { | ||||
// stat8H.weight), stat8H.count, | // stat8H.weight), stat8H.count, | ||||
// 100.0 * stat1D.reliability, 100.0 * (stat1D.reliability + 1.0 - | // 100.0 * stat1D.reliability, 100.0 * (stat1D.reliability + 1.0 - | ||||
// stat1D.weight), stat1D.count, | // stat1D.weight), stat1D.count, | ||||
// 100.0 * stat1W.reliability, 100.0 * (stat1W.reliability + 1.0 - | // 100.0 * stat1W.reliability, 100.0 * (stat1W.reliability + 1.0 - | ||||
// stat1W.weight), stat1W.count); | // stat1W.weight), stat1W.count); | ||||
} | } | ||||
bool CAddrDb::Get_(CServiceResult &ip, int &wait) { | bool CAddrDb::Get_(CServiceResult &ip, int &wait) { | ||||
int64 now = time(nullptr); | int64_t now = time(nullptr); | ||||
int cont = 0; | int cont = 0; | ||||
int tot = unkId.size() + ourId.size(); | int tot = unkId.size() + ourId.size(); | ||||
if (tot == 0) { | if (tot == 0) { | ||||
wait = 5; | wait = 5; | ||||
return false; | return false; | ||||
} | } | ||||
do { | do { | ||||
int rnd = rand() % tot; | int rnd = rand() % tot; | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |