From a9e960a4dd66f2b78b5bb97e310249dca9a14bcf Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 31 May 2016 22:06:58 +0200 Subject: [PATCH 1/2] Wait until we have more than a single addr response --- bitcoin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bitcoin.cpp b/bitcoin.cpp index 934ef60..6eecee8 100644 --- a/bitcoin.cpp +++ b/bitcoin.cpp @@ -136,7 +136,9 @@ class CNode { // printf("%s: got %i addresses\n", ToString(you).c_str(), (int)vAddrNew.size()); int64 now = time(NULL); vector::iterator it = vAddrNew.begin(); - if (doneAfter == 0 || doneAfter > now + 1) doneAfter = now + 1; + 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())); From e27d6c5b3d01f79fbbaff56b05d03f8bfa6ce11f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 31 May 2016 22:07:07 +0200 Subject: [PATCH 2/2] Adjust protocol timeouts --- bitcoin.cpp | 4 ++-- main.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitcoin.cpp b/bitcoin.cpp index 6eecee8..9ccbabf 100644 --- a/bitcoin.cpp +++ b/bitcoin.cpp @@ -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) { diff --git a/main.cpp b/main.cpp index 3e4c8e5..7ae9831 100644 --- a/main.cpp +++ b/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);