From 8701fc98a20a35119e0872e1fabb37b8931f5697 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 30 Jun 2026 15:59:47 +0200 Subject: [PATCH] blockchain_db: remove unused MDB_val_copy specializations The MDB_val_copy and MDB_val_copy 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. --- src/blockchain_db/lmdb/db_lmdb.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index ffc027031..ecd9e551b 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -106,36 +106,6 @@ private: T t_copy; }; -template<> -struct MDB_val_copy: 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 data; -}; - -template<> -struct MDB_val_copy: 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 data; -}; - } namespace cryptonote