Browse Source

Merge #9112: Avoid ugly exception in log on unknown inv type

e9f25dd Avoid ugly exception in log on unknown inv type (Wladimir J. van der Laan)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
46027e8668
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/protocol.cpp

6
src/protocol.cpp

@ -181,7 +181,11 @@ std::string CInv::GetCommand() const @@ -181,7 +181,11 @@ std::string CInv::GetCommand() const
std::string CInv::ToString() const
{
return strprintf("%s %s", GetCommand(), hash.ToString());
try {
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()

Loading…
Cancel
Save