Skip to content

Commit

Permalink
Remove GetAccount calls in epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored and czarcas7ic committed May 9, 2024
1 parent b9a3e8f commit bbb9a48
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions x/bank/keeper/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,12 @@ func (k BaseSendKeeper) SendManyCoins(ctx context.Context, fromAddr sdk.AccAddre
return err
}

acc := k.ak.GetAccount(ctx, toAddr)
if acc == nil {
defer telemetry.IncrCounter(1, "new", "account")
k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, toAddr))
}
// Not needed for epoch code, every user must have an account
// acc := k.ak.GetAccount(ctx, toAddr)
// if acc == nil {
// defer telemetry.IncrCounter(1, "new", "account")
// k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, toAddr))
// }

sdkCtx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand Down

0 comments on commit bbb9a48

Please sign in to comment.