Skip to content

Commit

Permalink
bridge is always active if there is no guardian
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed May 7, 2024
1 parent 0d21ba2 commit 25140e4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions x/fbridge/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ func (k Keeper) GetRoleMetadata(ctx sdk.Context) types.RoleMetadata {
}

func (k Keeper) GetBridgeStatus(ctx sdk.Context) types.BridgeStatus {
roleMeta := k.GetRoleMetadata(ctx)
bsMeta := k.GetBridgeStatusMetadata(ctx)
if types.CheckTrustLevelThreshold(roleMeta.Guardian, bsMeta.Inactive, k.GetParams(ctx).GuardianTrustLevel) {
return types.StatusInactive
if k.GetRoleMetadata(ctx).Guardian != 0 {
roleMeta := k.GetRoleMetadata(ctx)
bsMeta := k.GetBridgeStatusMetadata(ctx)
if types.CheckTrustLevelThreshold(roleMeta.Guardian, bsMeta.Inactive, k.GetParams(ctx).GuardianTrustLevel) {
return types.StatusInactive
}
}

return types.StatusActive
Expand Down

0 comments on commit 25140e4

Please sign in to comment.