Browse Source

Don't crash when the status is bad.

cl-refactor
Gav Wood 10 years ago
parent
commit
1c1951a39b
  1. 7
      libethereum/Client.cpp

7
libethereum/Client.cpp

@ -40,6 +40,8 @@ VersionChecker::VersionChecker(string const& _dbPath):
{ {
bytes statusBytes = contents(m_path + "/status"); bytes statusBytes = contents(m_path + "/status");
RLP status(statusBytes); RLP status(statusBytes);
try
{
auto protocolVersion = (unsigned)status[0]; auto protocolVersion = (unsigned)status[0];
auto minorProtocolVersion = (unsigned)status[1]; auto minorProtocolVersion = (unsigned)status[1];
auto databaseVersion = (unsigned)status[2]; auto databaseVersion = (unsigned)status[2];
@ -51,6 +53,11 @@ VersionChecker::VersionChecker(string const& _dbPath):
: :
WithExisting::Trust; WithExisting::Trust;
} }
catch (...)
{
m_action = WithExisting::Kill;
}
}
void VersionChecker::setOk() void VersionChecker::setOk()
{ {

Loading…
Cancel
Save