mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
tracing: Tracepoints for in- and outbound P2P msgs
Can be used to monitor in- and outbound node traffic. Based on ealier work by jb55. Co-authored-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
469b71ae62
commit
4224dec22b
7 changed files with 639 additions and 1 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include <util/check.h> // For NDEBUG compile time check
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
#include <util/trace.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
|
@ -4052,6 +4053,15 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
|
|||
}
|
||||
CNetMessage& msg(msgs.front());
|
||||
|
||||
TRACE6(net, inbound_message,
|
||||
pfrom->GetId(),
|
||||
pfrom->GetAddrName().c_str(),
|
||||
pfrom->ConnectionTypeAsString().c_str(),
|
||||
msg.m_command.c_str(),
|
||||
msg.m_recv.size(),
|
||||
msg.m_recv.data()
|
||||
);
|
||||
|
||||
if (gArgs.GetBoolArg("-capturemessages", false)) {
|
||||
CaptureMessage(pfrom->addr, msg.m_command, MakeUCharSpan(msg.m_recv), /* incoming */ true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue