Skip to content

Commit

Permalink
check if exist in genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Apr 4, 2024
1 parent 649dfaa commit 2cd4555
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/epochs/keeper/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ func (k Keeper) AddEpochInfo(ctx context.Context, epoch types.EpochInfo) error {
if epoch.StartTime.IsZero() {
epoch.StartTime = k.environment.HeaderService.GetHeaderInfo(ctx).Time
}
epoch.CurrentEpochStartHeight = k.environment.HeaderService.GetHeaderInfo(ctx).Height

if epoch.CurrentEpochStartHeight == 0 {
epoch.CurrentEpochStartHeight = k.environment.HeaderService.GetHeaderInfo(ctx).Height
}
return k.EpochInfo.Set(ctx, epoch.Identifier, epoch)
}

Expand Down

0 comments on commit 2cd4555

Please sign in to comment.