Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
count should not incremnet unless Insert is successful
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic committed Sep 19, 2023
1 parent 3c341c4 commit 7bc4707
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/mailbox/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ func (k *Keeper) Dispatch(goCtx context.Context, msg *types.MsgDispatch) (*types

// Insert the message id into the tree
err := k.Tree.Insert(id)
k.ImtCount++
if err != nil {
return nil, err
}
k.ImtCount++

// Store that the leaf
store.Set(types.MailboxIMTKey(k.Tree.Count()-1), id)

Expand Down

0 comments on commit 7bc4707

Please sign in to comment.