Skip to content

Commit

Permalink
fix: update helper fn
Browse files Browse the repository at this point in the history
  • Loading branch information
seantking committed Jan 13, 2022
1 parent 3ac112e commit c467787
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,10 @@ func (k Keeper) GetActiveChannelID(ctx sdk.Context, portID string) (string, bool

// HasActiveChannel retrieves the active channelID from the store key by the provided portID & checks if the channel in question is in state OPEN
func (k Keeper) HasActiveChannel(ctx sdk.Context, portID string) (string, bool) {
store := ctx.KVStore(k.storeKey)
key := icatypes.KeyActiveChannel(portID)

channelID := string(store.Get(key))
channelID, _ := k.GetActiveChannelID(ctx, portID)
channel, found := k.channelKeeper.GetChannel(ctx, portID, channelID)

if channel.State == channeltypes.OPEN && found {
if found && channel.State == channeltypes.OPEN {
return channelID, true
}

Expand Down

0 comments on commit c467787

Please sign in to comment.