Don't read block contents when checking block existence. (#4328)

This commit is contained in:
clemahieu 2023-11-06 16:37:19 +00:00 committed by GitHub
commit c774654dc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)