Skip to content

Commit

Permalink
fixed bug in store::clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-bb committed Sep 6, 2023
1 parent c665555 commit 76cbceb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions nano/node/rocksdb/rocksdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,19 +723,19 @@ int nano::rocksdb::store::drop (nano::write_transaction const & transaction_a, t
int nano::rocksdb::store::clear (::rocksdb::ColumnFamilyHandle * column_family)
{
::rocksdb::ReadOptions read_options;
::rocksdb::WriteOptions write_options;
::rocksdb::WriteBatch write_batch;
std::unique_ptr<::rocksdb::Iterator> it(db->NewIterator(read_options, column_family));
::rocksdb::WriteOptions write_options;
::rocksdb::WriteBatch write_batch;
std::unique_ptr<::rocksdb::Iterator> it (db->NewIterator (read_options, column_family));

for (it->SeekToFirst (); it->Valid (); it->Next ())
{
write_batch.Delete (column_family, it->key());
}
for (it->SeekToFirst (); it->Valid (); it->Next ())
{
write_batch.Delete (column_family, it->key ());
}

::rocksdb::Status status = db->Write(write_options, &write_batch);
release_assert(status.ok());
::rocksdb::Status status = db->Write (write_options, &write_batch);
release_assert (status.ok ());

return status.code();
return status.code ();
}

void nano::rocksdb::store::construct_column_family_mutexes ()
Expand Down

0 comments on commit 76cbceb

Please sign in to comment.