mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-11 06:11:07 +00:00
update state from store before use in reactor
This commit is contained in:
@@ -216,6 +216,10 @@ func (r *Reactor) OnStart(ctx context.Context) error {
|
||||
if err := r.state.Start(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := r.state.updateStateFromStore(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
go r.updateRoundStateRoutine(ctx)
|
||||
|
||||
@@ -248,9 +248,6 @@ func NewState(
|
||||
}
|
||||
|
||||
func (cs *State) updateStateFromStore() error {
|
||||
if cs.initialStatePopulated {
|
||||
return nil
|
||||
}
|
||||
state, err := cs.stateStore.Load()
|
||||
if err != nil {
|
||||
return fmt.Errorf("loading state: %w", err)
|
||||
@@ -266,7 +263,6 @@ func (cs *State) updateStateFromStore() error {
|
||||
|
||||
cs.updateToState(state)
|
||||
|
||||
cs.initialStatePopulated = true
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user