Skip to content

Commit

Permalink
check secondary sp in gvg
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnss committed Aug 24, 2023
1 parent 02e9014 commit 650c1fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/virtualgroup/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func (k msgServer) CreateGlobalVirtualGroup(goCtx context.Context, req *types.Ms
if !found {
return nil, sdkerrors.Wrapf(sptypes.ErrStorageProviderNotFound, "secondary sp not found, ID: %d", id)
}
if !ssp.IsInService() && !ssp.IsInMaintenance() {
return nil, sptypes.ErrStorageProviderNotInService.Wrapf("sp in GVG is not in service or in maintenance, status: %s", sp.Status.String())
}

secondarySpIds = append(secondarySpIds, ssp.Id)
gvgStatisticsWithinSP := k.GetOrCreateGVGStatisticsWithinSP(ctx, ssp.Id)
gvgStatisticsWithinSP.SecondaryCount++
Expand Down

0 comments on commit 650c1fe

Please sign in to comment.