Skip to content

Commit 7fba4f5

Browse files
remagpieforiequal0
authored andcommitted
Update the era with the value in current block's state
At `on_term_close`, the term_common_params is not updated to the new parameters yet. But the parameters in the current block's state is updated, so we should get the `era` from there.
1 parent 5c64737 commit 7fba4f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/consensus/tendermint/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl ConsensusEngine for Tendermint {
246246

247247
match term {
248248
0 => {}
249-
_ => match term_common_params.expect("Term common params should exist").era() {
249+
_ => match metadata.params().map_or(0, |p| p.era()) {
250250
0 => {}
251251
1 => block.state_mut().snapshot_term_params()?,
252252
_ => unimplemented!("It is not decided how we handle this"),

0 commit comments

Comments
 (0)