From c6cb743588ccf60752ced80477661e5eff97f219 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Wed, 16 Sep 2015 11:09:53 -0400 Subject: [PATCH] db_management.cpp: Remove loop that does nothing --- libraries/chain/db_management.cpp | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/libraries/chain/db_management.cpp b/libraries/chain/db_management.cpp index c33b3ad1..2010bc1f 100644 --- a/libraries/chain/db_management.cpp +++ b/libraries/chain/db_management.cpp @@ -131,34 +131,19 @@ void database::open( FC_CAPTURE_AND_RETHROW( (data_dir) ) } - void database::close(uint32_t blocks_to_rewind) { _pending_block_session.reset(); - for(uint32_t i = 0; i < blocks_to_rewind && head_block_num() > 0; ++i) - { - block_id_type popped_block_id = head_block_id(); - pop_block(); - _fork_db.remove(popped_block_id); - try - { - _block_id_to_block.remove(popped_block_id); - } - catch (const fc::key_not_found_exception&) - { - } - } - // pop all of the blocks that we can given our undo history, this should // throw when there is no more undo history to pop - try + try { - while( true ) - { - elog("pop"); + while( true ) + { + elog("pop"); block_id_type popped_block_id = head_block_id(); - pop_block(); + pop_block(); _fork_db.remove(popped_block_id); // doesn't throw on missing try { @@ -167,8 +152,8 @@ void database::close(uint32_t blocks_to_rewind) catch (const fc::key_not_found_exception&) { } - } - } + } + } catch (...) { }