From c774654dc6c03653461916acd8f9610e71b4ee3f Mon Sep 17 00:00:00 2001 From: clemahieu Date: Mon, 6 Nov 2023 16:37:19 +0000 Subject: [PATCH] Don't read block contents when checking block existence. (#4328) --- nano/store/lmdb/block.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nano/store/lmdb/block.cpp b/nano/store/lmdb/block.cpp index e01d71fb21..ff6113f089 100644 --- a/nano/store/lmdb/block.cpp +++ b/nano/store/lmdb/block.cpp @@ -122,9 +122,7 @@ void nano::store::lmdb::block::del (store::write_transaction const & transaction bool nano::store::lmdb::block::exists (store::transaction const & transaction, nano::block_hash const & hash) { - nano::store::lmdb::db_val junk; - block_raw_get (transaction, hash, junk); - return junk.size () != 0; + return store.exists (transaction, tables::blocks, hash); } uint64_t nano::store::lmdb::block::count (store::transaction const & transaction_a)