Skip to content

Commit

Permalink
prevent unlinkable_block_exception from printing full block content i…
Browse files Browse the repository at this point in the history
…nto log - just the block header is sufficient in that case
  • Loading branch information
ABW committed Oct 14, 2024
1 parent 7ec6328 commit 215c398
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/plugins/chain/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ bool chain_plugin_impl::push_block( const block_flow_control& block_ctrl, uint32
{
const std::shared_ptr<full_block_type>& full_block = block_ctrl.get_full_block();
const signed_block& new_block = full_block->get_block();
const signed_block_header& new_block_header = new_block;

uint32_t block_num = full_block->get_block_num();
if( checkpoints.size() && checkpoints.rbegin()->second != block_id_type() )
Expand Down Expand Up @@ -993,7 +994,12 @@ bool chain_plugin_impl::push_block( const block_flow_control& block_ctrl, uint32
db.notify_finish_push_block( full_block );
block_ctrl.on_end_of_apply_block();
}
FC_CAPTURE_AND_RETHROW((new_block))
catch( unlinkable_block_exception& er )
{
// we only need header (if anything at all) in most common case of block from unknown fork
FC_RETHROW_EXCEPTION( er, warn, "", FC_FORMAT_ARG_PARAMS( (new_block_header) ) );
}
FC_CAPTURE_AND_RETHROW( (new_block) )

db.check_free_memory( false, full_block->get_block_num() );
});
Expand Down

0 comments on commit 215c398

Please sign in to comment.