Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show All 27 Lines | |||||
#include <scheduler.h> | #include <scheduler.h> | ||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
#include <txmempool.h> | #include <txmempool.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <memory> | #include <memory> | ||||
#include <typeinfo> | |||||
#if defined(NDEBUG) | #if defined(NDEBUG) | ||||
#error "Bitcoin cannot be compiled without assertions." | #error "Bitcoin cannot be compiled without assertions." | ||||
#endif | #endif | ||||
/** Expiration time for orphan transactions in seconds */ | /** Expiration time for orphan transactions in seconds */ | ||||
static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60; | static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60; | ||||
/** Minimum time between orphan transactions expire time checks in seconds */ | /** Minimum time between orphan transactions expire time checks in seconds */ | ||||
▲ Show 20 Lines • Show All 3,979 Lines • ▼ Show 20 Lines | try { | ||||
connman, m_banman, interruptMsgProc); | connman, m_banman, interruptMsgProc); | ||||
if (interruptMsgProc) { | if (interruptMsgProc) { | ||||
return false; | return false; | ||||
} | } | ||||
if (!pfrom->vRecvGetData.empty()) { | if (!pfrom->vRecvGetData.empty()) { | ||||
fMoreWork = true; | 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) { | } 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 (...) { | } catch (...) { | ||||
PrintExceptionContinue(nullptr, "ProcessMessages()"); | LogPrint(BCLog::NET, "%s(%s, %u bytes): Unknown exception caught\n", | ||||
__func__, SanitizeString(strCommand), nMessageSize); | |||||
} | } | ||||
if (!fRet) { | if (!fRet) { | ||||
LogPrint(BCLog::NET, "%s(%s, %u bytes) FAILED peer=%d\n", __func__, | LogPrint(BCLog::NET, "%s(%s, %u bytes) FAILED peer=%d\n", __func__, | ||||
SanitizeString(strCommand), nMessageSize, pfrom->GetId()); | SanitizeString(strCommand), nMessageSize, pfrom->GetId()); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
▲ Show 20 Lines • Show All 938 Lines • Show Last 20 Lines |