diff --git a/x/crosschain/keeper/msg_server_vote_inbound_tx.go b/x/crosschain/keeper/msg_server_vote_inbound_tx.go index 366636fab5..34e71be9b0 100644 --- a/x/crosschain/keeper/msg_server_vote_inbound_tx.go +++ b/x/crosschain/keeper/msg_server_vote_inbound_tx.go @@ -2,6 +2,8 @@ package keeper import ( "context" + errorsmod "cosmossdk.io/errors" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/zeta-chain/zetacore/common" @@ -55,6 +57,11 @@ func (k msgServer) VoteOnObservedInboundTx(goCtx context.Context, msg *types.Msg ctx := sdk.UnwrapSDKContext(goCtx) index := msg.Digest() + // Check if the inbound has already been processed. + if k.IsFinalizedInbound(ctx, msg.InTxHash, msg.SenderChainId, msg.EventIndex) { + return nil, errorsmod.Wrap(types.ErrObservedTxAlreadyFinalized, fmt.Sprintf("InTxHash:%s, SenderChainID:%d, EventIndex:%d", msg.InTxHash, msg.SenderChainId, msg.EventIndex)) + } + // vote on inbound ballot finalized, err := k.zetaObserverKeeper.VoteOnInboundBallot( ctx, diff --git a/x/observer/keeper/vote_inbound.go b/x/observer/keeper/vote_inbound.go index da5744b5cd..f663a9b768 100644 --- a/x/observer/keeper/vote_inbound.go +++ b/x/observer/keeper/vote_inbound.go @@ -70,10 +70,6 @@ func (k Keeper) VoteOnInboundBallot( return false, err } if isNew { - // Check if the inbound has already been processed. - //if k.IsFinalizedInbound(ctx, msg.InTxHash, msg.SenderChainId, msg.EventIndex) { - // return false, errorsmod.Wrap(types.ErrObservedTxAlreadyFinalized, fmt.Sprintf("InTxHash:%s, SenderChainID:%d, EventIndex:%d", msg.InTxHash, msg.SenderChainId, msg.EventIndex)) - //} EmitEventBallotCreated(ctx, ballot, inTxHash, senderChain.String()) }