Skip to content

Commit

Permalink
Don't read block contents when checking block existence. (#4328)
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu authored Nov 6, 2023
1 parent ef0dde6 commit c774654
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nano/store/lmdb/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c774654

Please sign in to comment.