aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-03-23 23:31:50 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-03-23 23:32:20 +0800
commitbecc503230ecf259fefbd261ea0abf54bbbb0f5b (patch)
tree3d0f5c8d5f1da821a7c69fce0b5c3a4dd0851eab /core
parent5d31a475e93807fb1b3a71765fe66138cacd15e7 (diff)
downloaddexon-becc503230ecf259fefbd261ea0abf54bbbb0f5b.tar.gz
dexon-becc503230ecf259fefbd261ea0abf54bbbb0f5b.tar.zst
dexon-becc503230ecf259fefbd261ea0abf54bbbb0f5b.zip
Correct difficulty calculation to use new difficulty minimum
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 1bc8edea6..73b68358b 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -32,8 +32,10 @@ type StateQuery interface {
func CalcDifficulty(block, parent *types.Header) *big.Int {
diff := new(big.Int)
- min := big.NewInt(2048)
- adjust := new(big.Int).Div(parent.Difficulty, min)
+ diffBoundDiv := big.NewInt(2048)
+ min := big.NewInt(131072)
+
+ adjust := new(big.Int).Div(parent.Difficulty, diffBoundDiv)
if (block.Time - parent.Time) < 8 {
diff.Add(parent.Difficulty, adjust)
} else {