Skip to content

Commit

Permalink
fix: de-deduplicate inTxHashToCctx (#1077)
Browse files Browse the repository at this point in the history
Co-authored-by: brewmaster012 <>
  • Loading branch information
brewmaster012 authored Sep 6, 2023
1 parent 12fbfbc commit e4329f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion x/crosschain/keeper/keeper_cross_chain_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ func (k Keeper) SetCctxAndNonceToCctxAndInTxHashToCctx(ctx sdk.Context, send typ
// set mapping inTxHash -> cctxIndex
in, _ := k.GetInTxHashToCctx(ctx, send.InboundTxParams.InboundTxObservedHash)
in.InTxHash = send.InboundTxParams.InboundTxObservedHash
in.CctxIndex = append(in.CctxIndex, send.Index)
found := false
for _, cctxIndex := range in.CctxIndex {
if cctxIndex == send.Index {
found = true
break
}
}
if !found {
in.CctxIndex = append(in.CctxIndex, send.Index)
}
k.SetInTxHashToCctx(ctx, in)

tss, found := k.GetTSS(ctx)
Expand Down

0 comments on commit e4329f5

Please sign in to comment.