diff options
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -31,6 +31,7 @@ #include <condition_variable> #include <cstdint> #include <deque> +#include <functional> #include <map> #include <memory> #include <optional> @@ -1272,7 +1273,17 @@ private: }; /** Dump binary message to file, with timestamp */ -void CaptureMessage(const CAddress& addr, const std::string& msg_type, const Span<const unsigned char>& data, bool is_incoming); +void CaptureMessageToFile(const CAddress& addr, + const std::string& msg_type, + const Span<const unsigned char>& data, + bool is_incoming); + +/** Defaults to `CaptureMessageToFile()`, but can be overridden by unit tests. */ +extern std::function<void(const CAddress& addr, + const std::string& msg_type, + const Span<const unsigned char>& data, + bool is_incoming)> + CaptureMessage; struct NodeEvictionCandidate { |