Skip to content

Commit

Permalink
#1588 rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Jan 18, 2024
1 parent 2d0e3d5 commit 7c67a04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libskale/SnapshotManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,14 @@ void SnapshotManager::computeDatabaseHash(
secp256k1_sha256_t dbCtx;
secp256k1_sha256_initialize( &dbCtx );

std::string finishKey = "start";
std::string lastHashedKey = "start";

while ( finishKey != "stop" ) {
while ( lastHashedKey != "stop" ) {
std::unique_ptr< dev::db::LevelDB > m_db( new dev::db::LevelDB( _dbDir.string(),
dev::db::LevelDB::defaultSnapshotReadOptions(), dev::db::LevelDB::defaultWriteOptions(),
dev::db::LevelDB::defaultSnapshotDBOptions() ) );

m_db->hashBasePartially( &dbCtx, finishKey );
m_db->hashBasePartially( &dbCtx, lastHashedKey );
}

dev::h256 dbHash;
Expand Down
6 changes: 3 additions & 3 deletions test/unittests/libweb3core/LevelDBHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ BOOST_AUTO_TEST_CASE( hash ) {
secp256k1_sha256_t dbCtx;
secp256k1_sha256_initialize( &dbCtx );

std::string finishKey = "start";
while ( finishKey != "stop" ) {
std::string lastHashedKey = "start";
while ( lastHashedKey != "stop" ) {
std::unique_ptr< dev::db::LevelDB > m_db( new dev::db::LevelDB( td.path(),
dev::db::LevelDB::defaultSnapshotReadOptions(), dev::db::LevelDB::defaultWriteOptions(),
dev::db::LevelDB::defaultSnapshotDBOptions() ) );

m_db->hashBasePartially( &dbCtx, finishKey, 10 );
m_db->hashBasePartially( &dbCtx, lastHashedKey, 10 );
}

secp256k1_sha256_finalize( &dbCtx, hashPartially.data() );
Expand Down

0 comments on commit 7c67a04

Please sign in to comment.