Skip to content

Commit

Permalink
Fix replay steemit#551
Browse files Browse the repository at this point in the history
  • Loading branch information
leinlawun authored and On1x committed Oct 15, 2018
1 parent 3c953ca commit 940c8a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
11 changes: 0 additions & 11 deletions libraries/chain/database.cpp
Expand Up @@ -266,7 +266,6 @@ namespace graphene { namespace chain {

void database::reindex(const fc::path &data_dir, const fc::path &shared_mem_dir, uint32_t from_block_num, uint64_t shared_file_size) {
try {
signal_guard sg;
_fork_db.reset(); // override effect of _fork_db.start_block() call in open()

auto start = fc::time_point::now();
Expand All @@ -293,10 +292,6 @@ namespace graphene { namespace chain {

set_reserved_memory(1024*1024*1024); // protect from memory fragmentations ...
while (cur_block_num < last_block_num) {
if (signal_guard::get_is_interrupted()) {
return;
}

auto end = fc::time_point::now();
auto cur_block = *_block_log.read_block_by_num(cur_block_num);

Expand Down Expand Up @@ -324,12 +319,6 @@ namespace graphene { namespace chain {
set_revision(head_block_num());
});

if (signal_guard::get_is_interrupted()) {
sg.restore();

appbase::app().quit();
}

if (_block_log.head()->block_num()) {
_fork_db.start_block(*_block_log.head());
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/include/graphene/chain/database.hpp
Expand Up @@ -435,6 +435,8 @@ namespace graphene { namespace chain {

const block_log &get_block_log() const;

const block_log &get_block_log() const;

protected:
//Mark pop_undo() as protected -- we do not want outside calling pop_undo(); it should call pop_block() instead
//void pop_undo() { object_database::pop_undo(); }
Expand Down
Expand Up @@ -115,6 +115,8 @@ namespace graphene {

FC_DECLARE_DERIVED_EXCEPTION(database_signal_exception, graphene::chain::chain_exception, 4130000, "database signal exception")

FC_DECLARE_DERIVED_EXCEPTION(database_revision_exception, graphene::chain::chain_exception, 4120000, "database revision exception")

}
} // graphene::chain

Expand Down

0 comments on commit 940c8a3

Please sign in to comment.