Browse Source

signatures and path

cl-refactor
Vlad Gluhovsky 10 years ago
parent
commit
9edfae2e6a
  1. 4
      libwhisper/WhisperDB.cpp
  2. 8
      libwhisper/WhisperDB.h

4
libwhisper/WhisperDB.cpp

@ -29,13 +29,13 @@ using namespace dev::shh;
WhisperDB::WhisperDB()
{
string path = dev::getDataDir();
string path = dev::getDataDir("shh");
boost::filesystem::create_directories(path);
leveldb::Options op;
op.create_if_missing = true;
op.max_open_files = 256;
leveldb::DB* p = nullptr;
leveldb::Status status = leveldb::DB::Open(op, path + "/whisper", &p);
leveldb::Status status = leveldb::DB::Open(op, path + "/messages", &p);
m_db.reset(p);
if (!status.ok())
BOOST_THROW_EXCEPTION(FailedToOpenLevelDB(status.ToString()));

8
libwhisper/WhisperDB.h

@ -30,10 +30,10 @@ namespace dev
namespace shh
{
struct FailedToOpenLevelDB: virtual Exception { FailedToOpenLevelDB(std::string _message = std::string()): Exception(_message) {} };
struct FailedInsertInLevelDB: virtual Exception { FailedInsertInLevelDB(std::string _message = std::string()): Exception(_message) {} };
struct FailedLookupInLevelDB: virtual Exception { FailedLookupInLevelDB(std::string _message = std::string()): Exception(_message) {} };
struct FailedDeleteInLevelDB: virtual Exception { FailedDeleteInLevelDB(std::string _message = std::string()): Exception(_message) {} };
struct FailedToOpenLevelDB: virtual Exception { FailedToOpenLevelDB(std::string const& _message): Exception(_message) {} };
struct FailedInsertInLevelDB: virtual Exception { FailedInsertInLevelDB(std::string const& _message): Exception(_message) {} };
struct FailedLookupInLevelDB: virtual Exception { FailedLookupInLevelDB(std::string const& _message): Exception(_message) {} };
struct FailedDeleteInLevelDB: virtual Exception { FailedDeleteInLevelDB(std::string const& _message): Exception(_message) {} };
class WhisperDB
{

Loading…
Cancel
Save