Skip to content

Commit

Permalink
fix(node): genesis.json not loaded on restart before genesis block is…
Browse files Browse the repository at this point in the history
… mined
  • Loading branch information
lklimek authored Aug 29, 2024
1 parent 1c717ad commit ad4f911
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 ad4f911

Please sign in to comment.