Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/main.cpp
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | do { | ||||
res.nBanTime = 0; | res.nBanTime = 0; | ||||
res.nClientV = 0; | res.nClientV = 0; | ||||
res.nHeight = 0; | res.nHeight = 0; | ||||
res.strClientV = ""; | res.strClientV = ""; | ||||
bool getaddr = res.ourLastSuccess + 86400 < now; | bool getaddr = res.ourLastSuccess + 86400 < now; | ||||
res.fGood = TestNode(res.service, res.nBanTime, res.nClientV, | res.fGood = TestNode(res.service, res.nBanTime, res.nClientV, | ||||
res.strClientV, res.nHeight, | res.strClientV, res.nHeight, | ||||
getaddr ? &addr : nullptr); | getaddr ? &addr : nullptr); | ||||
if (!res.fGood && !res.fReliable && res.hasRunTestNodeBefore && | |||||
res.timeSinceFoundOrLastSuccess > 2 * 86400) { | |||||
res.nBanTime = std::max(100000, res.nBanTime); | |||||
} | |||||
jasonbcox: This introduces ban logic for the first time in this function. Why? Ban logic already exists… | |||||
} | } | ||||
db.ResultMany(ips); | db.ResultMany(ips); | ||||
db.Add(addr); | db.Add(addr); | ||||
} while (1); | } while (1); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines |
This introduces ban logic for the first time in this function. Why? Ban logic already exists in TestNode() and further down that call stack. Isn't it more appropriate somewhere in there?