aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-11-11 10:58:13 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-11-11 10:58:58 +0100
commit46027e8668ecd5755743ab778d1329af84a54653 (patch)
tree85e1ca1ad7f3c1a6444c86e02b9319e74bf6eb27
parent21e6c6b569c5b190783a7e9741220562b828ccfe (diff)
parente9f25ddd0063f7ea65595178d04370d27344305c (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.cpp6
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()