Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Remove misleading messages when memoryDB is used
Browse files Browse the repository at this point in the history
  • Loading branch information
halfalicious committed Nov 26, 2019
1 parent 43399c0 commit 1d5742b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions libethereum/BlockChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,9 @@ bool BlockChain::open(fs::path const& _path, WithExisting _we)
{
// Determine which database open call failed
auto const dbPath = !m_blocksDB.get() ? db_paths::blocksDatabasePath() : db_paths::extrasDatabasePath();
LOG(m_loggerError) << "Error opening database: " << dbPath;

if (db::isDiskDatabase())
{
LOG(m_loggerError) << "Error occurred when opening database: " << dbPath;
db::DatabaseStatus const dbStatus = *boost::get_error_info<db::errinfo_dbStatusCode>(ex);
if (fs::space(db_paths::chainPath()).available < 1024)
{
Expand All @@ -282,7 +281,8 @@ bool BlockChain::open(fs::path const& _path, WithExisting _we)
}
}

LOG(m_loggerError) << "Unknown error occurred. Exception details: " << ex.what();
LOG(m_loggerError) << "Unknown error occurred when opening database. Exception details: "
<< ex.what();
throw;
}

Expand Down
12 changes: 6 additions & 6 deletions libethereum/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,16 @@ OverlayDB State::openDB(fs::path const& _basePath, h256 const& _genesisHash, Wit

try
{
clog(VerbosityTrace, "statedb") << "Opening state database (and creating if not present): "
<< db_paths::stateDatabasePath();
clog(VerbosityTrace, "statedb") << "Opening state database";
std::unique_ptr<db::DatabaseFace> db = db::DBFactory::create(db_paths::stateDatabasePath());
return OverlayDB(std::move(db));
}
catch (boost::exception const& ex)
{
clog(VerbosityError, "statedb")
<< "Error opening state database: " << db_paths::stateDatabasePath();
if (db::isDiskDatabase())
{
clog(VerbosityError, "statedb")
<< "Error opening state database: " << db_paths::stateDatabasePath();
db::DatabaseStatus const dbStatus =
*boost::get_error_info<db::errinfo_dbStatusCode>(ex);
if (fs::space(db_paths::stateDatabasePath()).available < 1024)
Expand All @@ -93,8 +92,9 @@ OverlayDB State::openDB(fs::path const& _basePath, h256 const& _genesisHash, Wit
BOOST_THROW_EXCEPTION(DatabaseAlreadyOpen());
}
}
clog(VerbosityError, "statedb") << "Unknown error encountered. Exception details: "
<< boost::diagnostic_information(ex);
clog(VerbosityError, "statedb")
<< "Unknown error encountered when opening state database. Exception details: "
<< boost::diagnostic_information(ex);
throw;
}
}
Expand Down

0 comments on commit 1d5742b

Please sign in to comment.