#245 Add try-catch block for update_account_histories

This commit is contained in:
Vladislav Dobromyslov 2022-01-28 05:44:29 -04:00
parent 43fbe98240
commit 910362baf8

View file

@ -78,6 +78,8 @@ account_history_plugin_impl::~account_history_plugin_impl()
} }
void account_history_plugin_impl::update_account_histories( const signed_block& b ) void account_history_plugin_impl::update_account_histories( const signed_block& b )
{
try \
{ {
graphene::chain::database& db = database(); graphene::chain::database& db = database();
vector<optional< operation_history_object > >& hist = db.get_applied_operations(); vector<optional< operation_history_object > >& hist = db.get_applied_operations();
@ -198,6 +200,19 @@ void account_history_plugin_impl::update_account_histories( const signed_block&
skip_oho_id(); skip_oho_id();
} }
} }
catch( const boost::exception& e )
{
elog( "Caught account_history_plugin::update_account_histories(...) boost::exception: ${e}", ("e", boost::diagnostic_information(e) ) );
}
catch( const std::exception& e )
{
elog( "Caught account_history_plugin::update_account_histories(...) std::exception: ${e}", ("e", e.what() ) );
}
catch( ... )
{
wlog( "Caught unexpected exception in account_history_plugin::update_account_histories(...)" );
}
}
void account_history_plugin_impl::add_account_history( const account_id_type account_id, const operation_history_id_type op_id ) void account_history_plugin_impl::add_account_history( const account_id_type account_id, const operation_history_id_type op_id )
{ {