From 9a0a106dca1261f136107fa96650686ed68a66c4 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sat, 21 Jul 2018 13:42:32 +1000 Subject: [PATCH] Add comments to main transition fn --- src/state/transition/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/state/transition/mod.rs b/src/state/transition/mod.rs index 51fce8fae0..4564453faa 100644 --- a/src/state/transition/mod.rs +++ b/src/state/transition/mod.rs @@ -43,7 +43,13 @@ pub fn compute_state_transition ( { let is_new_epoch = parent_act_state.height % config.epoch_length == 0; - + + /* + * If this transition will push the chain into a new epoch, + * calculate a new crystallized state and "reset" the + * current active state. Otherwise, continue with the existing + * state pair. + */ let (cry_state, mut act_state) = match is_new_epoch { false => (parent_cry_state.clone(), parent_act_state.clone()), true => initialize_new_epoch( @@ -58,7 +64,6 @@ pub fn compute_state_transition ( "epoch" => cry_state.current_epoch); } - act_state = compute_new_active_state( &cry_state, &act_state,