Skip to content

Commit

Permalink
Merge pull request #365 from MinterTeam/v1.1.8-hotfix
Browse files Browse the repository at this point in the history
V1.1.8 hotfix
  • Loading branch information
danil-lashin authored Aug 28, 2020
2 parents e82123c + 5fb3b44 commit e2378cf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.1.8

BUG FIXES

- [core] Handle coins with 0-total-valued stakes

## 1.1.7

IMPROVEMENT
Expand Down
4 changes: 4 additions & 0 deletions core/state/candidates/candidates.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ func (c *Candidates) calculateBipValue(coinSymbol types.CoinSymbol, amount *big.
return big.NewInt(0).Set(amount)
}

if amount.Cmp(big.NewInt(0)) == 0 {
return big.NewInt(0)
}

totalAmount := big.NewInt(0)
if includeSelf {
totalAmount.Set(amount)
Expand Down
3 changes: 2 additions & 1 deletion upgrades/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package upgrades
const UpgradeBlock1 = 5000
const UpgradeBlock2 = 38519
const UpgradeBlock3 = 109000
const UpgradeBlock4 = 3183842

func IsUpgradeBlock(height uint64) bool {
upgradeBlocks := []uint64{UpgradeBlock1, UpgradeBlock2, UpgradeBlock3}
upgradeBlocks := []uint64{UpgradeBlock1, UpgradeBlock2, UpgradeBlock3, UpgradeBlock4}

for _, block := range upgradeBlocks {
if height == block {
Expand Down
1 change: 1 addition & 0 deletions upgrades/grace.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var gracePeriods = []*gracePeriod{
NewGracePeriod(UpgradeBlock1, UpgradeBlock1+120),
NewGracePeriod(UpgradeBlock2, UpgradeBlock2+120),
NewGracePeriod(UpgradeBlock3, UpgradeBlock3+120),
NewGracePeriod(UpgradeBlock4, UpgradeBlock4+120),
}

type gracePeriod struct {
Expand Down
4 changes: 2 additions & 2 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ package version
const (
Maj = "1"
Min = "1"
Fix = "7"
Fix = "8"

AppVer = 6
)

var (
// Must be a string because scripts like dist.sh read this file.
Version = "1.1.7"
Version = "1.1.8"

// GitCommit is the current HEAD set using ldflags.
GitCommit string
Expand Down

0 comments on commit e2378cf

Please sign in to comment.