|
|
@ -259,16 +259,21 @@ public: |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
bool TestNode(const CIPPort &cip, int &ban, int &clientV, vector<CAddress>& vAddr) { |
|
|
|
bool TestNode(const CIPPort &cip, int &ban, int &clientV, vector<CAddress>& vAddr) { |
|
|
|
CNode node(cip, vAddr); |
|
|
|
try { |
|
|
|
bool ret = node.Run(); |
|
|
|
CNode node(cip, vAddr); |
|
|
|
if (!ret) { |
|
|
|
bool ret = node.Run(); |
|
|
|
ban = node.GetBan(); |
|
|
|
if (!ret) { |
|
|
|
} else { |
|
|
|
ban = node.GetBan(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ban = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
clientV = node.GetClientVersion(); |
|
|
|
|
|
|
|
// printf("%s: %s!!!\n", cip.ToString().c_str(), ret ? "GOOD" : "BAD");
|
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
} catch(std::ios_base::failure& e) { |
|
|
|
ban = 0; |
|
|
|
ban = 0; |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
clientV = node.GetClientVersion(); |
|
|
|
|
|
|
|
// printf("%s: %s!!!\n", cip.ToString().c_str(), ret ? "GOOD" : "BAD");
|
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|