mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-14 06:32:33 +01:00
Use spans of std::byte in serialize
This switches .read() and .write() to take spans of bytes.
This commit is contained in:
@@ -147,7 +147,7 @@ public:
|
||||
template<typename K> bool GetKey(K& key) {
|
||||
leveldb::Slice slKey = piter->key();
|
||||
try {
|
||||
CDataStream ssKey(MakeUCharSpan(slKey), SER_DISK, CLIENT_VERSION);
|
||||
CDataStream ssKey{MakeByteSpan(slKey), SER_DISK, CLIENT_VERSION};
|
||||
ssKey >> key;
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
template<typename V> bool GetValue(V& value) {
|
||||
leveldb::Slice slValue = piter->value();
|
||||
try {
|
||||
CDataStream ssValue(MakeUCharSpan(slValue), SER_DISK, CLIENT_VERSION);
|
||||
CDataStream ssValue{MakeByteSpan(slValue), SER_DISK, CLIENT_VERSION};
|
||||
ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent));
|
||||
ssValue >> value;
|
||||
} catch (const std::exception&) {
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
dbwrapper_private::HandleError(status);
|
||||
}
|
||||
try {
|
||||
CDataStream ssValue(MakeUCharSpan(strValue), SER_DISK, CLIENT_VERSION);
|
||||
CDataStream ssValue{MakeByteSpan(strValue), SER_DISK, CLIENT_VERSION};
|
||||
ssValue.Xor(obfuscate_key);
|
||||
ssValue >> value;
|
||||
} catch (const std::exception&) {
|
||||
|
||||
Reference in New Issue
Block a user