Avoid ugly exception in log on unknown inv type (#1457)
This commit is contained in:
parent
8572d54a98
commit
b272ae56a6
@ -265,7 +265,11 @@ const char* CInv::GetCommand() const
|
|||||||
|
|
||||||
std::string CInv::ToString() const
|
std::string CInv::ToString() const
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
return strprintf("%s %s", GetCommand(), hash.ToString());
|
return strprintf("%s %s", GetCommand(), hash.ToString());
|
||||||
|
} catch(const std::out_of_range &) {
|
||||||
|
return strprintf("0x%08x %s", type, hash.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<std::string> &getAllNetMessageTypes()
|
const std::vector<std::string> &getAllNetMessageTypes()
|
||||||
|
Loading…
Reference in New Issue
Block a user