diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-11-11 10:58:13 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-11-11 10:58:58 +0100 |
| commit | 46027e8668ecd5755743ab778d1329af84a54653 (patch) | |
| tree | 85e1ca1ad7f3c1a6444c86e02b9319e74bf6eb27 /src/protocol.cpp | |
| parent | Merge #9114: [depends] Set OSX_MIN_VERSION to 10.8 (diff) | |
| parent | Avoid ugly exception in log on unknown inv type (diff) | |
| download | discoin-46027e8668ecd5755743ab778d1329af84a54653.tar.xz discoin-46027e8668ecd5755743ab778d1329af84a54653.zip | |
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)
Diffstat (limited to 'src/protocol.cpp')
| -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 54ad62b1a..87d6e0684 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() |