From 09280b7939fada5b9bd72efa9828e0ac7b1c64c3 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Sun, 5 Nov 2023 23:37:05 +0000 Subject: [PATCH] Don't read block contents when checking block existence. --- 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)