blockchain_db: remove unused MDB_val_copy specializations

The MDB_val_copy<cryptonote::blobdata> and MDB_val_copy<const char*>
specializations have no references anywhere in the tree (src/, contrib/,
tests/); the full build still links cleanly.

They were real helpers that copied block/tx blobs and the "version" key into
LMDB from 2015 (3fcb8daf6 / f7e99047e). All instantiations were removed in
99fbe1008 (2018, "db_lmdb: save some string copies for readonly db keys/
values"), which writes blobs directly and points readonly MDB_vals at string
literals (zero-copy). Every remaining MDB_val_copy<> call site uses the
uint64_t/uint32_t/uint8_t primary template; these two specializations have sat
unused since.
This commit is contained in:
Thomas
2026-06-30 15:59:47 +02:00
parent 00d21ee75e
commit 8701fc98a2
-30
View File
@@ -106,36 +106,6 @@ private:
T t_copy;
};
template<>
struct MDB_val_copy<cryptonote::blobdata>: public MDB_val
{
MDB_val_copy(const cryptonote::blobdata &bd) :
data(new char[bd.size()])
{
memcpy(data.get(), bd.data(), bd.size());
mv_size = bd.size();
mv_data = data.get();
}
private:
std::unique_ptr<char[]> data;
};
template<>
struct MDB_val_copy<const char*>: public MDB_val
{
MDB_val_copy(const char *s):
size(strlen(s)+1), // include the NUL, makes it easier for compares
data(new char[size])
{
mv_size = size;
mv_data = data.get();
memcpy(mv_data, s, size);
}
private:
size_t size;
std::unique_ptr<char[]> data;
};
}
namespace cryptonote