Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12944997
D5800.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D5800.id.diff
View Options
diff --git a/src/seeder/bitcoin.h b/src/seeder/bitcoin.h
--- a/src/seeder/bitcoin.h
+++ b/src/seeder/bitcoin.h
@@ -75,7 +75,4 @@
int GetStartingHeight() { return nStartingHeight; }
};
-bool TestNode(const CService &cip, int &ban, int &client, std::string &clientSV,
- int &blocks, std::vector<CAddress> *vAddr);
-
#endif // BITCOIN_SEEDER_BITCOIN_H
diff --git a/src/seeder/bitcoin.cpp b/src/seeder/bitcoin.cpp
--- a/src/seeder/bitcoin.cpp
+++ b/src/seeder/bitcoin.cpp
@@ -327,26 +327,3 @@
sock = INVALID_SOCKET;
return (ban == 0) && res;
}
-
-bool TestNode(const CService &cip, int &ban, int &clientV,
- std::string &clientSV, int &blocks,
- std::vector<CAddress> *vAddr) {
- try {
- CSeederNode node(cip, vAddr);
- bool ret = node.Run();
- if (!ret) {
- ban = node.GetBan();
- } else {
- ban = 0;
- }
- clientV = node.GetClientVersion();
- clientSV = node.GetClientSubVersion();
- blocks = node.GetStartingHeight();
- // tfm::format(std::cout, "%s: %s!!!\n", cip.ToString().c_str(), ret ?
- // "GOOD" : "BAD");
- return ret;
- } catch (std::ios_base::failure &e) {
- ban = 0;
- return false;
- }
-}
diff --git a/src/seeder/main.cpp b/src/seeder/main.cpp
--- a/src/seeder/main.cpp
+++ b/src/seeder/main.cpp
@@ -190,9 +190,24 @@
res.nHeight = 0;
res.strClientV = "";
bool getaddr = res.ourLastSuccess + 86400 < now;
- res.fGood = TestNode(res.service, res.nBanTime, res.nClientV,
- res.strClientV, res.nHeight,
- getaddr ? &addr : nullptr);
+ try {
+ CSeederNode node(res.service, getaddr ? &addr : nullptr);
+ bool ret = node.Run();
+ if (!ret) {
+ res.nBanTime = node.GetBan();
+ } else {
+ res.nBanTime = 0;
+ }
+ res.nClientV = node.GetClientVersion();
+ res.strClientV = node.GetClientSubVersion();
+ res.nHeight = node.GetStartingHeight();
+ // tfm::format(std::cout, "%s: %s!!!\n", cip.ToString().c_str(),
+ // ret ? "GOOD" : "BAD");
+ res.fGood = ret;
+ } catch (std::ios_base::failure &e) {
+ res.nBanTime = 0;
+ res.fGood = false;
+ }
}
db.ResultMany(ips);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 6, 16:57 (20 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5082733
Default Alt Text
D5800.id.diff (2 KB)
Attached To
D5800: Remove TestNode()
Event Timeline
Log In to Comment