diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-01-02 11:31:25 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-01-02 11:40:31 +0100 |
commit | fa24493d6394b3a477535f480664c9596f18e3c5 (patch) | |
tree | 56fb2f98aba2055c959c57ffb8022dbcd21f8d27 /src/wallet/bdb.cpp | |
parent | fa65bbf217b725ada35107b4ad646d250228355c (diff) | |
download | bitcoin-fa24493d6394b3a477535f480664c9596f18e3c5.tar.xz |
Use spans of std::byte in serialize
This switches .read() and .write() to take spans of bytes.
Diffstat (limited to 'src/wallet/bdb.cpp')
-rw-r--r-- | src/wallet/bdb.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp index 5b264ac4ad..88969afbce 100644 --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -680,10 +680,10 @@ bool BerkeleyBatch::ReadAtCursor(CDataStream& ssKey, CDataStream& ssValue, bool& // Convert to streams ssKey.SetType(SER_DISK); ssKey.clear(); - ssKey.write((char*)datKey.get_data(), datKey.get_size()); + ssKey.write({BytePtr(datKey.get_data()), datKey.get_size()}); ssValue.SetType(SER_DISK); ssValue.clear(); - ssValue.write((char*)datValue.get_data(), datValue.get_size()); + ssValue.write({BytePtr(datValue.get_data()), datValue.get_size()}); return true; } @@ -755,7 +755,7 @@ bool BerkeleyBatch::ReadKey(CDataStream&& key, CDataStream& value) SafeDbt datValue; int ret = pdb->get(activeTxn, datKey, datValue, 0); if (ret == 0 && datValue.get_data() != nullptr) { - value.write((char*)datValue.get_data(), datValue.get_size()); + value.write({BytePtr(datValue.get_data()), datValue.get_size()}); return true; } return false; |