net: pass Span by value to CaptureMessage()

Span is lightweight and need not be passed by const reference.
pull/20196/head
Vasil Dimov 3 years ago
parent 3cb9d9c861
commit f98cdcb357
No known key found for this signature in database
GPG Key ID: 54DF06F64B55CBBF

@ -3087,7 +3087,7 @@ uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const
void CaptureMessageToFile(const CAddress& addr,
const std::string& msg_type,
const Span<const unsigned char>& data,
Span<const unsigned char> data,
bool is_incoming)
{
// Note: This function captures the message at the time of processing,
@ -3118,6 +3118,6 @@ void CaptureMessageToFile(const CAddress& addr,
std::function<void(const CAddress& addr,
const std::string& msg_type,
const Span<const unsigned char>& data,
Span<const unsigned char> data,
bool is_incoming)>
CaptureMessage = CaptureMessageToFile;

@ -1275,13 +1275,13 @@ private:
/** Dump binary message to file, with timestamp */
void CaptureMessageToFile(const CAddress& addr,
const std::string& msg_type,
const Span<const unsigned char>& data,
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,
Span<const unsigned char> data,
bool is_incoming)>
CaptureMessage;

Loading…
Cancel
Save