Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
Merge branch 'devshares' into bitshares
Browse files Browse the repository at this point in the history
  • Loading branch information
vikramrajkumar committed Feb 7, 2015
2 parents e52e03f + 2236af3 commit 40e3d0b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions libraries/blockchain/chain_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace bts { namespace blockchain {

_property_db.open( data_dir / "index/property_db" );
const optional<variant> version = self->get_property( database_version );
if( !version.valid() || version->as_int64() < BTS_BLOCKCHAIN_DATABASE_VERSION )
if( !version.valid() || version->as_int64() != BTS_BLOCKCHAIN_DATABASE_VERSION )
{
if( !rebuild_index )
{
Expand All @@ -138,10 +138,6 @@ namespace bts { namespace blockchain {
}
self->set_property( database_version, BTS_BLOCKCHAIN_DATABASE_VERSION );
}
else if( version.valid() && version->as_int64() > BTS_BLOCKCHAIN_DATABASE_VERSION )
{
FC_CAPTURE_AND_THROW( new_database_version, (version)(BTS_BLOCKCHAIN_DATABASE_VERSION) );
}

_fork_number_db.open( data_dir / "index/fork_number_db" );
_fork_db.open( data_dir / "index/fork_db" );
Expand Down Expand Up @@ -1318,6 +1314,7 @@ namespace bts { namespace blockchain {
bool replay_blockchain = must_rebuild_index || last_block_num == uint32_t( -1 );
if( replay_blockchain )
{
std::cout << "Erasing all state\n";
close();
fc::remove_all( data_dir / "index" );
fc::create_directories( data_dir / "index");
Expand Down
2 changes: 1 addition & 1 deletion libraries/blockchain/include/bts/blockchain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @brief Defines global constants that determine blockchain behavior
*/
#define BTS_BLOCKCHAIN_VERSION 109
#define BTS_BLOCKCHAIN_DATABASE_VERSION 190
#define BTS_BLOCKCHAIN_DATABASE_VERSION uint64_t( 191 )

/**
* The address prepended to string representation of
Expand Down
1 change: 0 additions & 1 deletion libraries/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ void load_and_configure_chain_database( const fc::path& datadir,
}
else if (option_variables.count("rebuild-index"))
{
std::cout << "Erasing all state\n";
try
{
fc::remove_all(datadir / "chain/index");
Expand Down
2 changes: 1 addition & 1 deletion libraries/db/include/bts/db/cached_level_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace bts { namespace db {

void close()
{ try {
flush();
if( _db.is_open() ) flush();
_db.close();
_cache.clear();
_dirty_store.clear();
Expand Down

0 comments on commit 40e3d0b

Please sign in to comment.