Call CaptureMessage at appropriate locations

These calls are toggled by a debug-only "capturemessages" flag.  Default
disabled.
This commit is contained in:
Troy Giorshev
2020-07-13 14:00:03 -04:00
parent f2a77ff97b
commit 4d1a582549
3 changed files with 8 additions and 0 deletions

View File

@@ -2864,6 +2864,9 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
{
size_t nMessageSize = msg.data.size();
LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", SanitizeString(msg.m_type), nMessageSize, pnode->GetId());
if (gArgs.GetBoolArg("-capturemessages", false)) {
CaptureMessage(pnode->addr, msg.m_type, msg.data, /* incoming */ false);
}
// make sure we use the appropriate network transport format
std::vector<unsigned char> serializedHeader;