Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/main.cpp
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | do { | ||||
std::vector<CAddress> addr; | std::vector<CAddress> addr; | ||||
for (size_t i = 0; i < ips.size(); i++) { | for (size_t i = 0; i < ips.size(); i++) { | ||||
CServiceResult &res = ips[i]; | CServiceResult &res = ips[i]; | ||||
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; | ||||
bool wasReliable = res.fGood; | |||||
jasonbcox: Should the result ever be good if number of tries is 0? Is that even possible? | |||||
int64_t timeSinceLastSuccess = now - res.ourLastSuccess; | |||||
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 && !wasReliable && res.totalTries > 0 && | |||||
jasonbcoxUnsubmitted Not Done Inline ActionsIf we only want to know that the node has been checked successfully before, the service result should plainly provide that information. Also, this doesn't check for some level of "maturity" (probably a threshold on number of tries) of a bad node, so my understanding is nodes in IBD will be banned as soon as they fail to reply to the first peer test. The test plan does not appear to cover the mid-IBD case. jasonbcox: If we only want to know that the node has been checked successfully before, the service result… | |||||
timeSinceLastSuccess > 2 * 86400) { | |||||
nakihitoAuthorUnsubmitted Done Inline ActionsChange to timeSinceLastSuccess > 300) { for testing. nakihito: Change to `timeSinceLastSuccess > 300) {` for testing. | |||||
jasonbcoxUnsubmitted Not Done Inline ActionsNot for this patch, but this is a strong indication that this should be modifiable via command line args. This will make writing functional tests much easier. jasonbcox: Not for this patch, but this is a strong indication that this should be modifiable via command… | |||||
res.nBanTime = std::max(100000, res.nBanTime); | |||||
} | |||||
} | } | ||||
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 |
Should the result ever be good if number of tries is 0? Is that even possible?