diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -33,6 +33,7 @@ #include #include +#include #if defined(NDEBUG) #error "Bitcoin cannot be compiled without assertions." @@ -4028,31 +4029,13 @@ if (!pfrom->vRecvGetData.empty()) { fMoreWork = true; } - } catch (const std::ios_base::failure &e) { - if (strstr(e.what(), "end of data")) { - // Allow exceptions from under-length message on vRecv - LogPrint(BCLog::NET, - "%s(%s, %u bytes): Exception '%s' caught, normally caused " - "by a message being shorter than its stated length\n", - __func__, SanitizeString(strCommand), nMessageSize, - e.what()); - } else if (strstr(e.what(), "size too large")) { - // Allow exceptions from over-long size - LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught\n", - __func__, SanitizeString(strCommand), nMessageSize, - e.what()); - } else if (strstr(e.what(), "non-canonical ReadCompactSize()")) { - // Allow exceptions from non-canonical encoding - LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught\n", - __func__, SanitizeString(strCommand), nMessageSize, - e.what()); - } else { - PrintExceptionContinue(&e, "ProcessMessages()"); - } } catch (const std::exception &e) { - PrintExceptionContinue(&e, "ProcessMessages()"); + LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' (%s) caught\n", + __func__, SanitizeString(strCommand), nMessageSize, e.what(), + typeid(e).name()); } catch (...) { - PrintExceptionContinue(nullptr, "ProcessMessages()"); + LogPrint(BCLog::NET, "%s(%s, %u bytes): Unknown exception caught\n", + __func__, SanitizeString(strCommand), nMessageSize); } if (!fRet) { diff --git a/src/util/system.cpp b/src/util/system.cpp --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -17,6 +17,7 @@ #include #include +#include #if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)) #include