-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #580 from frankcrypto2023/dev/1.2-diff
Modify difficulty adjustment
- Loading branch information
Showing
15 changed files
with
784 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ type Block interface { | |
GetOrder() uint | ||
HasParents() bool | ||
GetMainParent() uint | ||
GetHeight() uint | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package model | ||
|
||
import ( | ||
"math/big" | ||
"time" | ||
|
||
"github.com/Qitmeer/qng/core/types/pow" | ||
) | ||
|
||
// DifficultyManager provides a method to resolve the | ||
// difficulty value of a block | ||
type DifficultyManager interface { | ||
RequiredDifficulty(block Block, newBlockTime time.Time, powInstance pow.IPow) (uint32, error) | ||
CalcEasiestDifficulty(bits uint32, duration time.Duration, powInstance pow.IPow) uint32 | ||
GetCurrentPowDiff(ib Block, powType pow.PowType) *big.Int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.