Commit eceeda1e authored by Pieter Wuille's avatar Pieter Wuille
Browse files

Catch p2p exceptions

parent 0195702c
......@@ -259,16 +259,21 @@ public:
};
bool TestNode(const CIPPort &cip, int &ban, int &clientV, vector<CAddress>& vAddr) {
CNode node(cip, vAddr);
bool ret = node.Run();
if (!ret) {
ban = node.GetBan();
} else {
try {
CNode node(cip, vAddr);
bool ret = node.Run();
if (!ret) {
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;
return false;
}
clientV = node.GetClientVersion();
// printf("%s: %s!!!\n", cip.ToString().c_str(), ret ? "GOOD" : "BAD");
return ret;
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment