diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-11-11 10:58:13 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-11-11 10:58:58 +0100 |
commit | 46027e8668ecd5755743ab778d1329af84a54653 (patch) | |
tree | 85e1ca1ad7f3c1a6444c86e02b9319e74bf6eb27 | |
parent | 21e6c6b569c5b190783a7e9741220562b828ccfe (diff) | |
parent | e9f25ddd0063f7ea65595178d04370d27344305c (diff) |
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)
-rw-r--r-- | src/protocol.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index 54ad62b1a2..87d6e06848 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -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() |