Skip to content

Commit

Permalink
Using files instead of directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Mar 16, 2015
1 parent f2f4a76 commit ddf5250
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions rai/core_test/block_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,16 @@ TEST (block_store, bad_path)
ASSERT_TRUE (init);
}

TEST (block_store, already_open)
TEST (block_store, DISABLED_already_open) // File can be shared
{
auto path (rai::unique_path ());
boost::filesystem::create_directories (path);
boost::filesystem::create_directories (path.parent_path ());
std::ofstream file;
file.open ((path / "accounts.ldb").string ().c_str ());
file.open (path.string ().c_str ());
ASSERT_TRUE (file.is_open ());
bool init (false);
rai::block_store store (init, path);
ASSERT_FALSE (init);
ASSERT_TRUE (init);
}

TEST (block_store, delete_iterator_entry)
Expand Down
2 changes: 1 addition & 1 deletion rai/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ class send_visitor : public rai::block_visitor

rai::node::node (rai::node_init & init_a, boost::shared_ptr <boost::asio::io_service> service_a, uint16_t port_a, boost::filesystem::path const & application_path_a, rai::processor_service & processor_a, rai::logging const & logging_a) :
service (processor_a),
store (init_a.block_store_init, application_path_a / "data"),
store (init_a.block_store_init, application_path_a / "data.ldb"),
gap_cache (*this),
ledger (store),
conflicts (*this),
Expand Down
4 changes: 2 additions & 2 deletions rai/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ rai::uint128_t rai::scale_up (uint64_t amount_a)
rai::mdb_env::mdb_env (bool & error_a, boost::filesystem::path const & path_a)
{
boost::system::error_code error;
boost::filesystem::create_directories (path_a, error);
boost::filesystem::create_directories (path_a.parent_path (), error);
if (!error)
{
auto status1 (mdb_env_create (&environment));
Expand All @@ -68,7 +68,7 @@ rai::mdb_env::mdb_env (bool & error_a, boost::filesystem::path const & path_a)
assert (status2 == 0);
auto status3 (mdb_env_set_mapsize (environment, 1024 * 1024 * 1024));
assert (status3 == 0);
auto status4 (mdb_env_open (environment, path_a.string ().c_str (), 0, 00600));
auto status4 (mdb_env_open (environment, path_a.string ().c_str (), MDB_NOSUBDIR, 00600));
error_a = status4 != 0;
}
else
Expand Down

0 comments on commit ddf5250

Please sign in to comment.