Skip to content

Commit

Permalink
fix(node): reset state if initial height was not committed
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Aug 29, 2024
1 parent 1c717ad commit e303a34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ func loadStateFromDBOrGenesisDocProvider(stateStore sm.Store, genDoc *types.Gene
return sm.State{}, err
}

if state.IsEmpty() {
// If genesis state wasn't mined yet (last block height is 0), we assume that loaded state should be wiped
if state.IsEmpty() || state.LastBlockHeight == 0 {
// 2. If it's not there, derive it from the genesis doc
state, err = sm.MakeGenesisState(genDoc)
if err != nil {
Expand Down

0 comments on commit e303a34

Please sign in to comment.