Skip to content

Commit becc503

Browse files
author
Gustav Simonsson
committed
Correct difficulty calculation to use new difficulty minimum
1 parent 5d31a47 commit becc503

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎core/chain_manager.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ type StateQuery interface {
3232
func CalcDifficulty(block, parent *types.Header) *big.Int {
3333
diff := new(big.Int)
3434

35-
min := big.NewInt(2048)
36-
adjust := new(big.Int).Div(parent.Difficulty, min)
35+
diffBoundDiv := big.NewInt(2048)
36+
min := big.NewInt(131072)
37+
38+
adjust := new(big.Int).Div(parent.Difficulty, diffBoundDiv)
3739
if (block.Time - parent.Time) < 8 {
3840
diff.Add(parent.Difficulty, adjust)
3941
} else {

0 commit comments

Comments
 (0)