mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 19:37:27 -03:00
net: pass Span by value to CaptureMessage()
Span is lightweight and need not be passed by const reference.
This commit is contained in:
parent
3cb9d9c861
commit
f98cdcb357
2 changed files with 4 additions and 4 deletions
|
@ -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…
Reference in a new issue