Skip to content

Commit

Permalink
Merge PR #4467: Revert Gas Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Jun 1, 2019
1 parent 80234ba commit f783cb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog

## 0.34.7

### Bug Fixes

#### SDK

* Fix gas consumption bug in `Undelegate` preventing the ability to sync from
genesis.

## 0.34.6

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions x/staking/keeper/delegation.go
Expand Up @@ -597,10 +597,10 @@ func (k Keeper) Undelegate(
return completionTime, err
}

balance := sdk.NewCoin(k.BondDenom(ctx), returnAmount)

// no need to create the ubd object just complete now
if completeNow {
balance := sdk.NewCoin(k.BondDenom(ctx), returnAmount)

// track undelegation only when remaining or truncated shares are non-zero
if !balance.IsZero() {
if _, err := k.bankKeeper.UndelegateCoins(ctx, delAddr, sdk.Coins{balance}); err != nil {
Expand Down

0 comments on commit f783cb7

Please sign in to comment.