aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorTroy Giorshev <troygiorshev@gmail.com>2020-07-13 14:00:03 -0400
committerTroy Giorshev <troygiorshev@gmail.com>2021-01-23 15:58:42 -0500
commit4d1a582549bc982d55e24585b0ba06f92f21e9da (patch)
tree926a3e2d20a05a4ad93e33913310aec9a001a9fa /src/net_processing.cpp
parentf2a77ff97bec09dd5fcc043d8659d8ec5dfb87c2 (diff)
downloadbitcoin-4d1a582549bc982d55e24585b0ba06f92f21e9da.tar.xz
Call CaptureMessage at appropriate locations
These calls are toggled by a debug-only "capturemessages" flag. Default disabled.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 7d89d3ea6e..d0a743e81c 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -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;