Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2011 The LevelDB Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file. See the AUTHORS file for names of contributors.5#ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_6#define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_8#include "db/dbformat.h"9#include "leveldb/write_batch.h"11namespace leveldb {13class MemTable;15// WriteBatchInternal provides static methods for manipulating a16// WriteBatch that we don't want in the public WriteBatch interface.17class WriteBatchInternal {18public:19// Return the number of entries in the batch.20static int Count(const WriteBatch* batch);22// Set the count for the number of entries in the batch.23static void SetCount(WriteBatch* batch, int n);25// Return the sequence number for the start of this batch.26static SequenceNumber Sequence(const WriteBatch* batch);28// Store the specified number as the sequence number for the start of29// this batch.30static void SetSequence(WriteBatch* batch, SequenceNumber seq);32static Slice Contents(const WriteBatch* batch) { return Slice(batch->rep_); }34static size_t ByteSize(const WriteBatch* batch) { return batch->rep_.size(); }36static void SetContents(WriteBatch* batch, const Slice& contents);38static Status InsertInto(const WriteBatch* batch, MemTable* memtable);40static void Append(WriteBatch* dst, const WriteBatch* src);41};43} // namespace leveldb45#endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.