From 26fe40d559b612e2caae2eeeda9d2b89ac342eeb Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Tue, 7 May 2024 19:00:15 +0900 Subject: [PATCH] bridge is always inactive if there is no guardian --- x/fbridge/keeper/keeper.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/x/fbridge/keeper/keeper.go b/x/fbridge/keeper/keeper.go index 7d87a7e979..18cc8e0ef9 100644 --- a/x/fbridge/keeper/keeper.go +++ b/x/fbridge/keeper/keeper.go @@ -129,12 +129,16 @@ 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 roleMeta.Guardian != 0 { + bsMeta := k.GetBridgeStatusMetadata(ctx) + if types.CheckTrustLevelThreshold(roleMeta.Guardian, bsMeta.Inactive, k.GetParams(ctx).GuardianTrustLevel) { + return types.StatusInactive + } + + return types.StatusActive } - return types.StatusActive + return types.StatusInactive } func (k Keeper) setBridgeInactiveCounter(ctx sdk.Context, nInactive uint64) {