aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-02 11:31:25 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-01-02 11:40:31 +0100
commitfa24493d6394b3a477535f480664c9596f18e3c5 (patch)
tree56fb2f98aba2055c959c57ffb8022dbcd21f8d27 /src/net.cpp
parentfa65bbf217b725ada35107b4ad646d250228355c (diff)
downloadbitcoin-fa24493d6394b3a477535f480664c9596f18e3c5.tar.xz
Use spans of std::byte in serialize
This switches .read() and .write() to take spans of bytes.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 019e77fd7a..9c78977700 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -3120,11 +3120,11 @@ void CaptureMessage(const CAddress& addr, const std::string& msg_type, const Spa
CAutoFile f(fsbridge::fopen(path, "ab"), SER_DISK, CLIENT_VERSION);
ser_writedata64(f, now.count());
- f.write(msg_type.data(), msg_type.length());
+ f.write(MakeByteSpan(msg_type));
for (auto i = msg_type.length(); i < CMessageHeader::COMMAND_SIZE; ++i) {
f << uint8_t{'\0'};
}
uint32_t size = data.size();
ser_writedata32(f, size);
- f.write((const char*)data.data(), data.size());
+ f.write(AsBytes(data));
}