mirror of
https://github.com/twisterarmy/twister-seeder.git
synced 2025-03-11 21:11:12 +00:00
Catch p2p exceptions
This commit is contained in:
parent
0195702cc6
commit
eceeda1eec
23
bitcoin.cpp
23
bitcoin.cpp
@ -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 {
|
||||
ban = 0;
|
||||
}
|
||||
clientV = node.GetClientVersion();
|
||||
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;
|
||||
return ret;
|
||||
} catch(std::ios_base::failure& e) {
|
||||
ban = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user