mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
dbwrapper: Use DataStream for batch operations
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <dbwrapper.h>
|
||||
|
||||
#include <clientversion.h>
|
||||
#include <logging.h>
|
||||
#include <random.h>
|
||||
#include <serialize.h>
|
||||
@@ -156,9 +155,9 @@ struct CDBBatch::WriteBatchImpl {
|
||||
leveldb::WriteBatch batch;
|
||||
};
|
||||
|
||||
CDBBatch::CDBBatch(const CDBWrapper& _parent) : parent(_parent),
|
||||
m_impl_batch{std::make_unique<CDBBatch::WriteBatchImpl>()},
|
||||
ssValue(SER_DISK, CLIENT_VERSION){};
|
||||
CDBBatch::CDBBatch(const CDBWrapper& _parent)
|
||||
: parent{_parent},
|
||||
m_impl_batch{std::make_unique<CDBBatch::WriteBatchImpl>()} {};
|
||||
|
||||
CDBBatch::~CDBBatch() = default;
|
||||
|
||||
@@ -168,7 +167,7 @@ void CDBBatch::Clear()
|
||||
size_estimate = 0;
|
||||
}
|
||||
|
||||
void CDBBatch::WriteImpl(Span<const std::byte> key, CDataStream& ssValue)
|
||||
void CDBBatch::WriteImpl(Span<const std::byte> key, DataStream& ssValue)
|
||||
{
|
||||
leveldb::Slice slKey(CharCast(key.data()), key.size());
|
||||
ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent));
|
||||
|
||||
Reference in New Issue
Block a user