Skip to content

Commit 9c32351

Browse files
committed
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)
2 parents c36ed80 + e27d6c5 commit 9c32351

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bitcoin.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class CNode {
2626

2727
int GetTimeout() {
2828
if (you.IsTor())
29-
return 60;
29+
return 120;
3030
else
31-
return 10;
31+
return 30;
3232
}
3333

3434
void BeginMessage(const char *pszCommand) {
@@ -136,7 +136,9 @@ class CNode {
136136
// printf("%s: got %i addresses\n", ToString(you).c_str(), (int)vAddrNew.size());
137137
int64 now = time(NULL);
138138
vector<CAddress>::iterator it = vAddrNew.begin();
139-
if (doneAfter == 0 || doneAfter > now + 1) doneAfter = now + 1;
139+
if (vAddrNew.size() > 1) {
140+
if (doneAfter == 0 || doneAfter > now + 1) doneAfter = now + 1;
141+
}
140142
while (it != vAddrNew.end()) {
141143
CAddress &addr = *it;
142144
// printf("%s: got address %s\n", ToString(you).c_str(), addr.ToString().c_str(), (int)(vAddr->size()));

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ extern "C" void* ThreadCrawler(void* data) {
159159
res.nClientV = 0;
160160
res.nHeight = 0;
161161
res.strClientV = "";
162-
bool getaddr = res.ourLastSuccess + 604800 < now;
162+
bool getaddr = res.ourLastSuccess + 86400 < now;
163163
res.fGood = TestNode(res.service,res.nBanTime,res.nClientV,res.strClientV,res.nHeight,getaddr ? &addr : NULL);
164164
}
165165
db.ResultMany(ips);

0 commit comments

Comments
 (0)