diff --git a/CHANGELOG.md b/CHANGELOG.md index 07212a74f..ebdc07c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.1.8 + +BUG FIXES + +- [core] Handle coins with 0-total-valued stakes + ## 1.1.7 IMPROVEMENT diff --git a/core/state/candidates/candidates.go b/core/state/candidates/candidates.go index 864be7b8c..4f429572f 100644 --- a/core/state/candidates/candidates.go +++ b/core/state/candidates/candidates.go @@ -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) diff --git a/upgrades/blocks.go b/upgrades/blocks.go index 59f410594..dff9e64c0 100644 --- a/upgrades/blocks.go +++ b/upgrades/blocks.go @@ -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 { diff --git a/upgrades/grace.go b/upgrades/grace.go index 869fa4bc0..e350ab55f 100644 --- a/upgrades/grace.go +++ b/upgrades/grace.go @@ -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 { diff --git a/version/version.go b/version/version.go index 9fdaa462a..1a8b0f81a 100755 --- a/version/version.go +++ b/version/version.go @@ -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