Reset block height for imported authorities #61
@ -40,6 +40,8 @@ func (k *Keeper) InitGenesis(ctx sdk.Context, data *registry.GenesisState) error
|
|||||||
for _, authority := range data.Authorities {
|
for _, authority := range data.Authorities {
|
||||||
// Only import authorities that are marked active.
|
// Only import authorities that are marked active.
|
||||||
if authority.Entry.Status == registry.AuthorityActive {
|
if authority.Entry.Status == registry.AuthorityActive {
|
||||||
|
// Reset authority height
|
||||||
|
authority.Entry.Height = uint64(ctx.BlockHeight())
|
||||||
if err := k.SaveNameAuthority(ctx, authority.Name, authority.Entry); err != nil {
|
if err := k.SaveNameAuthority(ctx, authority.Name, authority.Entry); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user