Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: no longer removing active channel mapping on close channel #730

Merged
merged 10 commits into from
Jan 14, 2022
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) {
crodriguezvega marked this conversation as resolved.
Show resolved Hide resolved
store := ctx.KVStore(k.storeKey)
key := icatypes.KeyActiveChannel(portID)

channelID := string(store.Get(key))
channelID, _ := k.GetActiveChannelID(ctx, portID)
colin-axner marked this conversation as resolved.
Show resolved Hide resolved
channel, found := k.channelKeeper.GetChannel(ctx, portID, channelID)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

just a suggestion

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

Expand Down