Fixes for handling authority expiry queue #40
@ -519,7 +519,8 @@ func (k Keeper) ProcessAuthorityExpiryQueue(ctx sdk.Context) error {
|
||||
|
||||
k.Logger(ctx).Info(fmt.Sprintf("Marking authority expired as no bond present: %s", name))
|
||||
|
||||
return nil
|
||||
// Continue with the loop
|
||||
continue
|
||||
}
|
||||
|
||||
// Try to renew the authority by taking rent.
|
||||
@ -585,7 +586,7 @@ func (k Keeper) deleteAuthorityExpiryQueue(ctx sdk.Context, name string, authori
|
||||
}
|
||||
}
|
||||
|
||||
if len(existingNamesList.Value) == 0 {
|
||||
if len(newNamesSlice) == 0 {
|
||||
return k.AuthorityExpiryQueue.Remove(ctx, expiryTime)
|
||||
} else {
|
||||
existingNamesList.Value = newNamesSlice
|
||||
|
@ -111,6 +111,11 @@ func (rk RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string
|
||||
// Mark as expired.
|
||||
authority.Status = registrytypes.AuthorityExpired
|
||||
logger(ctx).Info(fmt.Sprintf("No winner, marking authority as expired: %s", name))
|
||||
|
||||
logger(ctx).Info(fmt.Sprintf("Deleting the expiry queue entry: %s", name))
|
||||
if err = rk.k.deleteAuthorityExpiryQueue(ctx, name, authority); err != nil {
|
||||
logger(ctx).Error("Unable to delete expiry queue entry", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Forget about this auction now, we no longer need it.
|
||||
|
Loading…
Reference in New Issue
Block a user