From fa24493d6394b3a477535f480664c9596f18e3c5 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 2 Jan 2022 11:31:25 +0100 Subject: Use spans of std::byte in serialize This switches .read() and .write() to take spans of bytes. --- src/uint256.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/uint256.h') diff --git a/src/uint256.h b/src/uint256.h index 72681d09c9..5c3a2f5409 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -6,6 +6,8 @@ #ifndef BITCOIN_UINT256_H #define BITCOIN_UINT256_H +#include + #include #include #include @@ -96,13 +98,13 @@ public: template void Serialize(Stream& s) const { - s.write((char*)m_data, sizeof(m_data)); + s.write(MakeByteSpan(m_data)); } template void Unserialize(Stream& s) { - s.read((char*)m_data, sizeof(m_data)); + s.read(MakeWritableByteSpan(m_data)); } }; -- cgit v1.2.3