Merge #38: Wait for more than a single addr to come back
e27d6c5
Adjust protocol timeouts (Pieter Wuille)a9e960a
Wait until we have more than a single addr response (Pieter Wuille)
This commit is contained in:
commit
9c32351efd
2 changed files with 6 additions and 4 deletions
|
@ -26,9 +26,9 @@ class CNode {
|
|||
|
||||
int GetTimeout() {
|
||||
if (you.IsTor())
|
||||
return 60;
|
||||
return 120;
|
||||
else
|
||||
return 10;
|
||||
return 30;
|
||||
}
|
||||
|
||||
void BeginMessage(const char *pszCommand) {
|
||||
|
@ -136,7 +136,9 @@ class CNode {
|
|||
// printf("%s: got %i addresses\n", ToString(you).c_str(), (int)vAddrNew.size());
|
||||
int64 now = time(NULL);
|
||||
vector<CAddress>::iterator it = vAddrNew.begin();
|
||||
if (vAddrNew.size() > 1) {
|
||||
if (doneAfter == 0 || doneAfter > now + 1) doneAfter = now + 1;
|
||||
}
|
||||
while (it != vAddrNew.end()) {
|
||||
CAddress &addr = *it;
|
||||
// printf("%s: got address %s\n", ToString(you).c_str(), addr.ToString().c_str(), (int)(vAddr->size()));
|
||||
|
|
2
main.cpp
2
main.cpp
|
@ -159,7 +159,7 @@ extern "C" void* ThreadCrawler(void* data) {
|
|||
res.nClientV = 0;
|
||||
res.nHeight = 0;
|
||||
res.strClientV = "";
|
||||
bool getaddr = res.ourLastSuccess + 604800 < now;
|
||||
bool getaddr = res.ourLastSuccess + 86400 < now;
|
||||
res.fGood = TestNode(res.service,res.nBanTime,res.nClientV,res.strClientV,res.nHeight,getaddr ? &addr : NULL);
|
||||
}
|
||||
db.ResultMany(ips);
|
||||
|
|
Loading…
Reference in a new issue