Skip to content

Commit

Permalink
Check if pipe closed in add_and_finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeee committed Jul 13, 2023
1 parent 353606c commit 2b89556
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib/transition_handler/processor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ let add_and_finalize ~logger ~frontier ~catchup_scheduler
Mina_metrics.Block_latency.Inclusion_time.update
(Block_time.Span.to_time_span time_elapsed) ) ;
[%log internal] "Add_and_finalize_done" ;
Writer.write processed_transition_writer
(`Transition transition, `Source source, `Valid_cb valid_cb) ;
Catchup_scheduler.notify catchup_scheduler
~hash:(Mina_block.Validated.state_hash transition)
if Writer.is_closed processed_transition_writer then
Or_error.error_string "processed transitions closed"
else (
Writer.write processed_transition_writer
(`Transition transition, `Source source, `Valid_cb valid_cb) ;
Catchup_scheduler.notify catchup_scheduler
~hash:(Mina_block.Validated.state_hash transition) )

let process_transition ~context:(module Context : CONTEXT) ~trust_system
~verifier ~frontier ~catchup_scheduler ~processed_transition_writer
Expand Down

0 comments on commit 2b89556

Please sign in to comment.