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

@@ -4042,6 +4042,10 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
}
CNetMessage& msg(msgs.front());
if (gArgs.GetBoolArg("-capturemessages", false)) {
CaptureMessage(pfrom->addr, msg.m_command, MakeUCharSpan(msg.m_recv), /* incoming */ true);
}
msg.SetVersion(pfrom->GetCommonVersion());
const std::string& msg_type = msg.m_command;